Summary
CVE-2026-90774 is a path traversal vulnerability (CWE-22) in rustypaste, a minimal self-hosted file upload/pastebin service written in Rust. Versions before 0.18.1 validate the destination path before applying an optional, attacker-supplied custom filename HTTP header, allowing the header value to bypass the directory-escape checks that are supposed to confine uploads to the configured storage directory. The flaw is remotely exploitable without authentication and carries a high severity rating.
Technical details
- Root cause: rustypaste performs its "is this path inside the upload directory" validation on the initial/expected destination path, then separately applies the client-controlled
filenameheader to rename/relocate the stored file. Because the header value is applied after the safety check, it is never itself validated against the base directory. - Trigger condition: An attacker sends a file upload request (e.g., via
curl -F "[email protected]" -H "filename:../../override.txt") with a craftedfilenameheader containing directory-traversal sequences (../). - Attack vector: Network — the vulnerability is exploitable via a standard, unauthenticated HTTP upload request to any rustypaste instance that has the filename-override feature enabled (as it is by default).
- Impact: The crafted filename allows the resulting file to be written outside the intended upload directory, enabling arbitrary file write/overwrite on the host filesystem. Depending on deployment (e.g., web-root paths, cron directories, configuration files reachable by the process), this can lead to data corruption, service disruption, or further compromise such as planting web-accessible content or overwriting sensitive files.
Affected software
- Product: rustypaste (vendor: orhun)
- Affected versions: All versions prior to 0.18.1
- Fixed version: 0.18.1 and later
Severity
- CVSS v3.1 Base Score: 7.5 (High)
- CVSS v3.1 Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - (A CVSS v4.0 score of 8.7, High, is also associated with this CVE:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N)
Mitigation and recommended actions
- Immediate: Upgrade rustypaste to version 0.18.1 or later, which routes header-supplied filenames through the application’s safe path-joining logic to ensure the final path stays within the configured upload directory.
- If unable to patch immediately:
- Disable or restrict the custom filename override feature at the reverse proxy or application configuration layer if such a control is available in your deployment.
- Restrict network access to the rustypaste upload endpoint (e.g., via IP allow-listing, VPN, or authentication at a reverse proxy) to reduce exposure to untrusted clients.
- Run the rustypaste process with a dedicated, low-privilege OS account and minimal filesystem permissions so that any unauthorized write is contained to a non-sensitive location.
- Monitor upload directories and adjacent paths for unexpected files or modifications as a compensating detective control until the upgrade is applied.

