How This Bug Class Keeps Shipping

Arbitrary file write, where an attacker (or a privileged user they have compromised) controls the destination path, is one of the oldest primitives in the exploit catalogue, and it still lands in production software in 2026. On 2026-10-20, CISA added CVE-2026-96656 in Plex Media Server to the Known Exploited Vulnerabilities catalogue: an "external control of file name or path" bug in which an administrator can write arbitrary files that get executed when the server loads them. Five days later, Cisco published an advisory for CVE-2026-76519, an unauthenticated arbitrary file write in Cisco Secure Email Gateway reachable through the Advanced Malware Protection (AMP) attachment path. Different vendors, different trust boundaries, same anatomy. This post traces that anatomy in code, explains how to detect exposure, and examines why the pattern survives code review.

The lead finding: CVE-2026-96656 in Plex Media Server

Per the vendor description reproduced in the KEV entry, Plex Media Server "contains an external control of file name or path vulnerability which can allow an admin user to write arbitrary files that may be executed on load." The entry notes three siblings in the same advisory cluster: CVE-2026-96652 (SSRF via protocol parameter), CVE-2026-96654 (improper neutralization of encoded URI schemes allowing cross-plugin function calls), and CVE-2026-96655 (SSRF via /video/:/transcode/universal). The "admin user" precondition sounds like a mitigation in isolation; it is not, because CVE-2026-96652 accepts any X-Plex-Token value and lets the attacker force the server to issue arbitrary POSTs. Combine an SSRF that forges the server's own identity with a filename-controlled write executed on load, and the compound exploit becomes unauthenticated remote code execution against a media server routinely exposed to the internet.

The critical detail for defenders is the "executed on load" clause. This converts a mundane file write into code execution: the application has a code path (plugin loader, template cache, service manifest, scheduled task registration) that treats any file matching a naming convention on disk as a trusted artefact. Attacker-controlled path plus implicit-execution directory equals RCE.

The anatomy, in pseudocode

The vulnerable shape is nearly always this:

# Vulnerable: destination path is a string joined from user input,
# with no containment check and no allow-listed extension.
UPLOAD_ROOT = "/var/lib/app/plugins"

def write_asset(user_supplied_name: str, body: bytes) -> str:
    dest = os.path.join(UPLOAD_ROOT, user_supplied_name)
    with open(dest, "wb") as fh:            # follows symlinks, honours ".."
        fh.write(body)
    return dest

# Elsewhere, a loader does this at startup or on a timer:
for entry in os.listdir(UPLOAD_ROOT):
    if entry.endswith(".py"):
        importlib.import_module(f"plugins.{entry[:-3]}")  # executes on load

Three independent flaws exist; fixing any one in isolation still leaves the primitive alive:

  1. os.path.join does not sanitise. If user_supplied_name starts with / or contains .., the join silently escapes UPLOAD_ROOT.
  2. There is no post-join os.path.realpath() containment check against UPLOAD_ROOT.
  3. The loader treats "any file in the plugin directory with a given extension" as code. The write primitive and the execute primitive share a filesystem contract that was never explicitly declared.

The safe form, boring by design, looks like this:

import os, re

ALLOWED = re.compile(r"^[a-zA-Z0-9_\-]{1,64}\.plugin$")

def write_asset(user_supplied_name: str, body: bytes) -> str:
    if not ALLOWED.match(user_supplied_name):
        raise ValueError("rejected name")
    dest = os.path.realpath(os.path.join(UPLOAD_ROOT, user_supplied_name))
    if os.path.commonpath([dest, UPLOAD_ROOT]) != UPLOAD_ROOT:
        raise ValueError("path escape")
    fd = os.open(dest, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o640)
    with os.fdopen(fd, "wb") as fh:
        fh.write(body)
    return dest

O_NOFOLLOW defeats a pre-planted symlink. O_EXCL defeats a race where the attacker swaps the entry between the containment check and the write. commonpath is the containment check that startswith keeps getting wrong. The extension allow-list closes the gap between the write surface and the loader's execution contract.

The sibling case: CVE-2026-76519 in Cisco Secure Email Gateway

Cisco's advisory for CVE-2026-76519 describes "improper handling of email attachments when the file reputation service is enabled," reachable by "sending an email that contains a crafted attachment." A successful exploit lets the attacker "write arbitrary files and execute commands with root privileges on the underlying operating system." The attacker precondition is lower than in the Plex case: no credential, no token, just the ability to deliver mail to the inbound pipeline, which is the appliance's job.

The structural kinship is clear. A content handler (AMP file reputation) performs filesystem work on behalf of attacker-supplied data (the attachment), and the write path is not fully isolated from a code path that will later interpret the written artefact. The authoritative details are in Cisco's advisory; the key point is that the same bug class, "untrusted input decides where bytes land," ships in a security appliance from a vendor that invests heavily in hardening. Code review alone does not catch this. The two sides of the primitive (write surface, implicit-execution surface) are usually owned by different teams and reviewed in separate pull requests.

How to tell whether you are exposed

For the Plex case:

For the Cisco Secure Email Gateway case, apply the vendor's fixed-release guidance and verify that the AMP file reputation feature flag matches the advisory's exposure criteria. Preserve mail logs for the exposure window; the exploit vector is an attachment, so evidence of attempts lives in message tracking, not HTTP access logs.

Why this keeps shipping, and the obligation

Four pressures feed the pattern. First, path-joining APIs in every mainstream language default to literal behavior rather than safe behavior: they traverse without complaint. Second, plugin and cache directories are convention-driven by design, so the loader deliberately trusts whatever is on disk. Third, the authorisation gate ("admin only") feels like it closes the hole, but it rarely holds when the same product also ships an SSRF or a token-forgery sibling. Fourth, static analysis tools score these as "medium" when the sink is open(), because they cannot see the downstream loader that converts the write into execution.

For federal civilian agencies, CVE-2026-96656 is now in scope under CISA BOD 26-04, which carries the KEV remediation obligation forward and supersedes BOD 22-01. The directive does not grant discretion on whether to act; it requires remediation of KEV entries on the schedule the catalogue specifies for each item. Treat non-federal environments the same way for anything with known in-the-wild exploitation: a KEV listing is the most reliable public signal that an exploit chain already works against unpatched instances.

The bug class will keep shipping until the write side and the execute side are reviewed together. Until then, assume that every "admin-only arbitrary file write" is one chained SSRF away from unauthenticated remote code execution, and audit accordingly.

Verifiable security.