GitHub advisory · PyPI
openssl-encrypt sequential XOR cancels the last key-derivation stage
Description
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.
The flaw cancels only the last stage of the derivation. It is exploitable only when BOTH of the following hold:
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:
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.
format_version ∈ {8, 10}, produced by the --xor / --use-xor-composition option, and configured with a single KDF and no prior hashing.format_version 9; Independent XOR (v11/v13 with xor_mode=independent); streaming (v12); and any single-algorithm (non-XOR)…Manual fix · PyPI
pip install --upgrade "openssl_encrypt>=1.4.8"Sources