Arbitrary Code Execution in openssl-encrypt via Symlink Following
The openssl-encrypt Python package before version 1.4.9 is vulnerable to a symlink-following flaw in its verify-usb functionality, allowing attackers with physical access to removable drives to achieve arbitrary code execution via crafted __pycache__ files.
CVE search metadata
CVE search record: CVE-2026-81690. Severity: high. CVSS: 7.3. KEV: no. Product: openssl-encrypt, openssl_encrypt (< 1.4.9), openssl_encrypt (<= 1.4.8, 1.5.x), openssl-encrypt (<= 1.4.8). Brief: Arbitrary Code Execution in openssl-encrypt via Symlink Following. Brief link: https://feed.craftedsignal.io/briefs/2026-08-openssl-encrypt-symlink-vuln/
What's new
- 1. added coverage for openssl_encrypt (< 1.4.9) Aug 27, 19:13 via nvd
- 2. added coverage for openssl_encrypt (< 1.4.9) Aug 27, 19:13 via nvd
- 3. added coverage for openssl-encrypt (<= 1.4.8) Aug 27, 19:13 via nvd
- 4. added coverage for openssl_encrypt (<= 1.4.8, 1.5.x) Aug 27, 19:11 via nvd
- 5. added coverage for openssl_encrypt (< 1.4.9) Aug 27, 19:11 via nvd
The openssl-encrypt Python package (versions prior to 1.4.9) contains a critical symlink-following vulnerability in its verify-usb utility. The flaw arises from inconsistent handling of symbolic links during the directory scan process compared to the file verification stage. Specifically, the utility uses rglob() to enumerate drive contents, which treats symlinks as standard directories. Meanwhile, the verification logic uses O_NOFOLLOW, which only protects the final path component.
An attacker with physical access to a removable media device can exploit this by replacing a legitimate tool-tree directory with a symlink pointing to an attacker-controlled directory. This malicious copy contains identical files alongside a crafted .pyc file located in a pycache folder. CPython prioritizes loading these byte-identical .pyc files over recompilation. Because the scan fails to enumerate the malicious files within the symlinked structure, the verification tool reports a PASSED status, tricking the victim into executing the untrusted portable install.
Impact
Successful exploitation results in arbitrary code execution on the victim's host system when the portable software is launched. This primarily impacts users relying on the openssl-encrypt package for verifying integrity of removable media. The vulnerability affects both the 1.4.x and 1.5.x branches of the software.
Recommendation
- Upgrade the openssl-encrypt package to version 1.4.9 or later immediately to patch the symlink handling flaw.
- Implement strict removable media usage policies to prevent unauthorized physical access to devices used with high-integrity verification tools.
- Audit logs for instances of verify-usb tool usage and ensure the software binary paths remain within expected, read-only directories on the host, rather than relying solely on the portable media's internal check.
Immediate actions
Upgrade openssl-encrypt package to version 1.4.9 or later on all systems.
Mitigations
Restrict USB access to authorized devices only.
CVE-2026-81690