VAITP Dataset

← Back to the dataset

CVE-2026-81690

Symlink‑follow flaw in openssl‑encrypt allowlist scan lets malicious .pyc bypass verification.

  • CVSS 8.7
  • CWE-59
  • Design Defects
  • Local

openssl-encrypt (pip package) before 1.4.9 contains a symlink-following flaw in its verify-usb v2 added-file allowlist scan. The scan enumerated the drive with rglob(), which in CPython does not descend into symlinked directories and treats the symlink as an ordinary directory, while O_NOFOLLOW on the hash side binds only the final path component. An evil-maid attacker with physical access to the removable drive could replace a tool-tree directory with a symlink to a copy containing byte-identical files plus a planted __pycache__/*.pyc file (which CPython loads in preference to recompiling the clean .py). The planted file is never enumerated, added_files stays 0, and verify-usb reports PASSED, resulting in code execution when the victim runs the portable install. Fixed in 1.4.9 (affects both 1.4.x and 1.5.x lines).

CVSS base score
8.7
Published
2026-08-27
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Design Defects
Subcategory
Poorly Designed Access Controls
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
openssl-encrypt
Fixed by upgrading
Yes

Solution

Upgrade openssl‑encrypt to version 1.4.9 or later.

Vulnerable code sample

import os
import pathlib

def verify_usb(drive_path: str) -> bool:
    """
    Scan a removable drive for added files and compute a simple hash.
    Returns True if verification passes.
    """
    added_files = 0
    base = pathlib.Path(drive_path)

    # VULNERABLE: symlinked directories are traversed and their contents are not checked
    for file_path in base.rglob("*"):
        if file_path.is_file():
            # Open the file for hashing; O_NOFOLLOW only protects the final component
            fd = os.open(file_path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
            os.close(fd)
            added_files += 1

    return added_files == 0

Patched code sample

import os
import pathlib

def verify_usb(drive_path: str) -> bool:
    """
    Scan a removable drive for added files and compute a simple hash.
    Returns True if verification passes.
    """
    added_files = 0
    base = pathlib.Path(drive_path)

    # FIX: reject symlinked directories before descending into them
    for file_path in base.rglob("*"):
        # Skip any path that is a symlink (including directories)
        if file_path.is_symlink():
            continue
        if file_path.is_file():
            # Ensure the target is not a symlink before opening
            if os.path.islink(file_path):
                continue
            fd = os.open(file_path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
            os.close(fd)
            added_files += 1

    return added_files == 0

Cite this entry

@misc{vaitp:cve202681690,
  title        = {{Symlink‑follow flaw in openssl‑encrypt allowlist scan lets malicious .pyc bypass verification.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-81690},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-81690/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.