Vulnerability GHSA-vxf9-vwp6-2w43

Medium Risk
MEDIUM RISK
CVSS Score: 6.2
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
16 hours ago
December 03, 2026 at 10:52 PM UTC
openssl-encrypt sequential XOR cancels the last key-derivation stage
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.7
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.7

Summary

openssl-encrypt sequential XOR cancels the last key-derivation stage

Details

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:

  1. Exactly one KDF is configured (e.g. Argon2 alone), and
  2. 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-composition option, 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/v13 with xor_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

  1. 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.
  2. 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.
  3. Default-configured files (3 chained KDFs + chained hashes), the default mode, and independent XOR were never at risk and need no action.
  4. 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.

Related Vulnerabilities

Other vulnerabilities affecting the same packages

Low Risk
15 hours ago
openssl-encrypt HSM diagnostics and debug logging expose hardware-derived data
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.7 GHSA-p9g8-wvh4-2jmx
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.7 GHSA-p9g8-wvh4-2jmx
Unknown
3 months ago
No summary available
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3801
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3801
Unknown
3 months ago
No summary available
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3802
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3802
Unknown
3 months ago
No summary available
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3803
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3803
Unknown
3 months ago
No summary available
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3965
0.2.2 - 0.5.1 and 0.5.3 - 0.8.2 and 0.9.2 - 1.4.0b3 and 1.4.0b4 and 1.4.0b5 and 1.4.0b6 and 1.4.0b7 and 1.4.0b8 and 1.4.0 - 1.4.1rc2 and 1.4.1 - 1.4.2 and 1.4.4 - 1.4.8 PYSEC-2026-3965
View all vulnerabilities for these packages

Impacted packages

Timeline

Published
16 hours ago
December 03, 2026 at 10:52 PM UTC
Fixed (1.4.8)
4 months ago
July 12, 2026 at 12:33 PM UTC
Last Modified
15 hours ago
December 03, 2026 at 11:00 PM UTC