CVE-2026-74871: Openssl encrypt Openssl-encrypt Sequential XOR Cancels The Vulnerability
MODERATECVE-2026-74871 is a MODERATE (CVSS 6.2) openssl-encrypt sequential xor cancels the vulnerability (CWE-916: Use of Password Hash With Insufficient Computational Effort) affecting Openssl encrypt libraries in the PyPI ecosystem. The issue involves openssl-encrypt sequential xor cancels the last key-derivation stage. Remediation is available by upgrading affected packages to version 1.4.8.
CVE-2026-74871 at a Glance
Security Impact
CVSS: 6.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-74871
To remediate this vulnerability, upgrade all affected Openssl encrypt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install openssl_encrypt>=1.4.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show openssl_encrypt
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-74871, inspect your installed packages using pip:
pip show openssl_encrypt
Analyze the terminal output to locate any version of Openssl encrypt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.8), your application is affected.
Note: The pip show openssl_encrypt command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-916: Use of Password Hash With Insufficient Computational Effort, where the product generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive. In Openssl encrypt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-74871 Affected Openssl encrypt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
openssl_encrypt
|
PyPI |
< 1.4.8
|
1.4.8
|
References
Frequently Asked Questions
What is CVE-2026-74871?
Which Openssl encrypt versions are affected?
What version fixes CVE-2026-74871?
Is openssl_encrypt affected?
What is the CVSS score of CVE-2026-74871?
What CWE is associated with CVE-2026-74871?
How can I check PyPI dependencies for CVE-2026-74871?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vxf9-vwp6-2w43",
"modified" : "2026-12-03T22:52:57Z",
"published" : "2026-12-03T22:52:57Z",
"aliases" : [ "CVE-2026-74871" ],
"summary" : "openssl-encrypt sequential XOR cancels the last key-derivation stage",
"details" : "## Summary\n\nFiles encrypted in **sequential XOR** composition mode (`--xor` / `--use-xor-composition`, on-disk `format_version` 8 or 10) derive a key in which the **last stage cancels out**. The weakness is only security-relevant for a **specific, non-default configuration** (see Exploitability below). In that case the key derivation collapses to a single cheap `SHA256(password ‖ salt)`, completely bypassing the configured memory-hard KDF (e.g. Argon2) and allowing offline password guessing at plain-SHA256 speed.\n\n## Exploitability — preconditions (important)\n\nThe flaw cancels **only the last stage** of the derivation. It is exploitable **only when BOTH** of the following hold:\n\n1. **Exactly one KDF** is configured (e.g. Argon2 alone), **and**\n2. **No prior hashing** stage precedes it.\n\nOnly then does the cancellation remove the sole expensive stage, leaving just the initial `SHA256(pw‖salt)`.\n\n**Neither condition is the default — so default-configured files are NOT exploitable:**\n\n- The default uses **3 chained KDFs**, and **chained hash stages** are also on by default.\n- With multiple stages the cancellation drops only the *last* one; the surviving earlier KDF/hash snapshots remain XOR'd into the key, so the derivation stays memory-hard. The work factor is marginally reduced (one trailing stage removed), **not** bypassed.\n\nA file is therefore only at real risk if it was deliberately encrypted with a **single KDF and no preceding hash** — both departures from the shipped defaults.\n\n## Affected configurations\n\n- **Affected (on-disk):** files written in sequential XOR mode — `format_version ∈ {8, 10}`, produced by the `--xor` / `--use-xor-composition` option, **and** configured with a single KDF and no prior hashing.\n- **Not affected:** the default sequential-XOR configuration (3 chained KDFs + chained hashes); the default `format_version 9`; Independent XOR (`v11`/`v13` with `xor_mode=independent`); streaming (`v12`); and any single-algorithm (non-XOR) configuration.\n\n## Root cause\n\nIn sequential XOR mode the key is the XOR of every stage's normalized output snapshot. The code additionally appended the chain's **final** value to that accumulator — but the final value is identical to the **last stage's own snapshot** already present in the accumulator, so the two XOR to zero and the last stage drops out of the key:\n\n```python\n# xor_accumulator already contains the last stage's snapshot, then:\nsequential_result = normalize(final_chain_value) # == last stage's snapshot\nxor_accumulator.append(sequential_result) # XORs to 0 -> last stage cancels\n```\n\n## Impact\n\nThe surviving key material is the **initial** hash snapshot `SHA256(plaintext-password ‖ original-salt)` — computed *before* the chain runs (not a derived/chained value) — XOR'd with any earlier non-final stage snapshots.\n\n- **Single KDF, no prior hash (worst case, non-default):** the sole KDF is the last stage, so it cancels entirely. The key equals the cheap initial `SHA256(pw‖salt)`, **independent of the configured KDF time/memory cost**. Offline cracking proceeds at SHA-256 speed; the advertised memory-hardness provides no protection.\n- **Multiple stages (incl. the 3-KDF + hashes default):** only the last stage cancels. Earlier KDF/hash snapshots survive in the XOR, so the key still depends on memory-hard derivation. The cost is at most marginally reduced (one trailing stage removed), not eliminated.\n\nThis is a confidentiality weakness of data at rest: it does not expose plaintext directly, but for the affected non-default configuration it drastically lowers the work factor protecting weak/medium-strength passwords. \n## Fix\n\nResolved by introducing `format_version 13`, which carries an explicit `xor_mode` field and **omits the redundant final append** so every stage contributes to the key. `--xor` now writes `v13` with `xor_mode=sequential`. Decrypt routing is keyed on the on-disk `xor_mode` field rather than the version number. The legacy v8/v10 derivation is intentionally preserved (append-only) so existing files still decrypt, but they remain weak until re-encrypted.\n\n- 1.5.x fix: commit `fdf0c6fc`\n- 1.4.x backport: commit `1c122790`\n- Cross-line golden vector confirms v13-sequential keys match between the 1.4.x and 1.5.x implementations.\n- Note: v1.4.6 fixed the normal --xor v13 write path but the v1.4.8 fixes the residual library-write issue.\n\n## Mitigation / remediation\n\n1. **Re-encrypt** any `--xor` file that used a **single KDF with no prior hashing** — this is the only at-risk configuration. Re-encrypting with a patched build writes `v13`.\n2. Identify affected files with `openssl-encrypt info -i <file>.enc`: look for `xor_mode: sequential` with `format_version` 8/10 **and** a single-KDF / no-hash derivation config.\n3. Default-configured files (3 chained KDFs + chained hashes), the default mode, and independent XOR were never at risk and need no action.\n4. For genuinely affected files, treat the password as having had reduced protection and rotate it where the at-rest file may have been exposed to an adversary.\n\n## Discovery\n\nFound during an internal review of the XOR composition modes; fixed before any third-party disclosure. See `SECURITY.md` (ADVISORY 2026-02) and `openssl_encrypt/docs/FORMAT.md` §7.3 / §15 for the format-level details.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "openssl_encrypt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-vxf9-vwp6-2w43"
}, {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/commit/1c122790d6d914909514dbe026d051bc06c50844"
}, {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/commit/a7d2c9054f5b4374561c82665b24adfe3fad360c"
}, {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/commit/e1b6731fae6ed9d6b17ecdc3b72edc3b364ee339"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jahlives/openssl_encrypt"
}, {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/releases/tag/v1.4.8"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/blob/main/vulns/openssl-encrypt/PYSEC-2026-3976.yaml"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/cve-2026-74871"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/openssl-encrypt-before-kdf-bypass-via-sequential-xor"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-916" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-12-03T22:52:57Z",
"nvd_published_at" : null
}
}