CVE-2026-74871 — openssl-encrypt
Fix: jahlives/openssl_encrypt@1c12279CVE-2026-74871 is a CWE-916 vulnerability in openssl-encrypt. A fix is available for openssl-encrypt — see the affected versions and patch details below.
openssl_encrypt before 1.4.6 KDF Bypass via Sequential-XOR
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-74871.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
openssl-encryptReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
Files 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.
Exploitability — preconditions (important)
The flaw cancels only the last stage of the derivation. It is exploitable only when BOTH of the following hold:
- Exactly one KDF is configured (e.g. Argon2 alone), and
- No prior hashing stage precedes it.
Only then does the cancellation remove the sole expensive stage, leaving just the initial SHA256(pw‖salt).
Neither condition is the default — so default-configured files are NOT exploitable:
- The default uses 3 chained KDFs, and chained hash stages are also on by default.
- 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.
A 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.
Affected configurations
- Affected (on-disk): files written in sequential XOR mode —
format_version ∈ {8, 10}, produced by the--xor/--use-xor-compositionoption, and configured with a single KDF and no prior hashing. - Not affected: the default sequential-XOR configuration (3 chained KDFs + chained hashes); the default
format_version 9; Independent XOR (v11/v13withxor_mode=independent); streaming (v12); and any single-algorithm (non-XOR) configuration.
Root cause
In 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:
# xor_accumulator already contains the last stage's snapshot, then:
sequential_result = normalize(final_chain_value) # == last stage's snapshot
xor_accumulator.append(sequential_result) # XORs to 0 -> last stage cancels
Impact
The 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.
- 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. - 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.
This 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.
Fix
Resolved 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.
- 1.5.x fix: commit
fdf0c6fc - 1.4.x backport: commit
1c122790 - Cross-line golden vector confirms v13-sequential keys match between the 1.4.x and 1.5.x implementations.
- Note: v1.4.6 fixed the normal --xor v13 write path but the v1.4.8 fixes the residual library-write issue.
Mitigation / remediation
- Re-encrypt any
--xorfile that used a single KDF with no prior hashing — this is the only at-risk configuration. Re-encrypting with a patched build writesv13. - Identify affected files with
openssl-encrypt info -i <file>.enc: look forxor_mode: sequentialwithformat_version8/10 and a single-KDF / no-hash derivation config. - Default-configured files (3 chained KDFs + chained hashes), the default mode, and independent XOR were never at risk and need no action.
- 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.
Discovery
Found 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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | openssl-encrypt | all versions | 1.4.8pip install --upgrade 'openssl-encrypt==1.4.8' |
Affected Products
openssl encryptjahlivesDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for openssl-encrypt, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update openssl-encrypt to 1.4.8 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-74871 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2026-74871 in your dependencies?
Find it across PyPI, including transitive dependencies.