Skip to main content
Mallory
LowPublic exploit

Linux kernel crypto essiv ssize underflow

IdentifiersCVE-2025-40019CWE-191

CVE-2025-40019 is a Linux kernel vulnerability in the crypto ESSIV code path. The provided fix states: "crypto: essiv - Check ssize for decryption and in-place encryption" and "Move the ssize check to the start in essiv_aead_crypt so that it's also checked for decryption and in-place encryption." Based on that information, the flaw is an ssize validation error in essiv_aead_crypt where the size check was performed too late or only on some paths, allowing decryption and in-place encryption operations to proceed with an invalid signed size value. The issue is described in the supplied context as an "essiv ssize-underflow" technique. This indicates an integer underflow condition caused by improper validation of a signed size parameter in the ESSIV AEAD cryptographic processing path in the Linux kernel.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can trigger a kernel memory corruption condition through the ESSIV crypto path due to the ssize underflow. The supplied context shows this bug was used in a KernelCTF exploit submission against Linux 6.12.0 with mitigations, which strongly indicates practical exploitability for kernel compromise. The exact corruption primitive is not specified in the provided material, but the impact is at least denial of service via kernel crash, and potentially privilege escalation to arbitrary code execution in kernel context depending on the reachable corruption state.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure by limiting untrusted access to kernel crypto interfaces and attack paths that can reach the ESSIV AEAD code path. Minimize local attacker footholds, restrict execution of untrusted code, and disable or avoid configurations and subsystems that expose vulnerable cryptographic operations where operationally feasible. However, no complete mitigation is provided in the supplied content, and patching is the primary corrective action.

Remediation

Patch, then assume compromise.

Apply the upstream Linux kernel fix for CVE-2025-40019 that moves the ssize validation to the start of essiv_aead_crypt so the check is enforced for decryption and in-place encryption as well. Upgrade to a kernel release containing the vendor/backported patch. The provided context references affected versions as "6.0 - 6.12.82," but does not identify the first fixed version explicitly, so the exact fixed release should be confirmed from the relevant vendor advisory or stable kernel changelog before deployment planning.
PUBLIC EXPLOITS

Exploits

3 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 3 / 3 TOTALView more in app
CVE-2025-40019-POCMaturityPoCVerified exploit

Repository purpose: a minimal local proof-of-concept trigger for CVE-2025-40019 in the Linux kernel crypto ESSIV implementation (crypto/essiv.c). The bug is an insufficient validation of AEAD associated data length (req->assoclen) relative to IV size (crypto_aead_ivsize), allowing a negative offset (assoclen - ivsize) to be used as an unsigned start parameter in scatterwalk_map_and_copy(), leading to out-of-bounds access and a kernel crash. Structure: - pwn.c: Main PoC. Uses AF_ALG (Linux kernel crypto user API) to instantiate an AEAD transform named "essiv(authenc(hmac(sha256),cbc(aes)),sha256)". It builds a composite key buffer using rtnetlink rtattr layout (enc key length + auth key + enc key), sets it with setsockopt(ALG_SET_KEY), then crafts a sendmsg() with control messages: - ALG_SET_OP = ALG_OP_ENCRYPT - ALG_SET_IV with ivlen=16 - ALG_SET_AEAD_ASSOCLEN = 8 The payload data is [AAD(8 bytes)] + [plaintext(32 bytes)]. The key trigger condition is aad_len (8) < ivsize (16). - README.md and writeup.md: Detailed vulnerability explanation, root cause analysis, and patch snippet showing the fix (compute ssize=req->assoclen-ivsize and return -EINVAL if ssize<0). Includes an example crash trace (NULL deref in memcpy_to_sglist) and notes potential exploitability via heap grooming, but no exploitation primitives are implemented. - run.sh: Convenience script to reproduce in a QEMU VM (4G RAM, KVM, virtfs share, hostfwd 127.0.0.1:58613->:22, gdb stub enabled). Not part of the exploit logic itself. Exploit capabilities: - Local kernel attack surface trigger via AF_ALG AEAD interface. - Demonstrates reliable kernel oops/DoS by forcing the vulnerable negative-offset copy path. - No privilege escalation, infoleak, or RCE chain included; repository is a bug trigger PoC rather than a full exploit.

0xAtharvDisclosed Jan 2, 2026cbashlocal (kernel attack surface via AF_ALG crypto user API)
CVE-2025-40019-EssivMaturityPoCVerified exploit

This repository contains a proof-of-concept (PoC) exploit for CVE-2025-40019, targeting the Linux kernel's ESSIV cryptographic module via the AF_ALG socket interface. The main file, '2test-essiv.c', is a C program that sets up an AEAD (Authenticated Encryption with Associated Data) operation using the ESSIV mode, configures keys, and attempts to perform an encryption operation. The code is designed to trigger or test for a vulnerability in the ESSIV implementation, potentially causing the kernel to hang or misbehave, as indicated by the poll timeout and debugging instructions in the code and README. The exploit is local and requires access to the kernel crypto API. The README provides additional context on kernel data structures relevant to exploitation. The repository is structured simply, with one C source file and a README, and is clearly marked as a work-in-progress PoC.

xooxoDisclosed Dec 30, 2025clocal
CVE-2025-40019_POCMaturityPoCVerified exploit

This repository contains a proof-of-concept (POC) exploit for CVE-2025-40019, as indicated by the README and the filename. The main file, 'poc.c', is a C program that demonstrates the use of the Linux kernel's AF_ALG socket interface to perform authenticated encryption using the 'essiv(authenc(hmac(sha256),cbc(aes)),sha256)' algorithm. The code sets up custom keys, IV, and AAD, and sends a message to the kernel crypto API, then receives and prints the resulting ciphertext and authentication tag. This POC is likely intended to demonstrate or trigger a vulnerability in the kernel's cryptographic subsystem related to this algorithm. There are no network endpoints or remote attack vectors; the exploit is purely local and interacts with the kernel via the AF_ALG interface. The repository is minimal, containing only a license, a short README, and the exploit code.

guard-waitDisclosed Nov 16, 2025clocal
What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity3

Community discussion across Reddit, Mastodon, and other social sources.