Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-105314 Overview
CVE-2026-105314 is a directory traversal vulnerability in Papermerge 3.5.3 that enables authenticated remote code execution. A standard user can abuse the /api/documents/upload endpoint to write arbitrary files outside the intended storage directory. By placing a Python .pth file into the Python site-packages directory, an attacker causes arbitrary code to execute the next time the Python interpreter starts. The flaw is classified under CWE-24: Path Traversal: '../filedir' and affects the open-source document management system Papermerge Core.
Critical Impact
Any authenticated low-privilege user can achieve code execution on the server by writing a crafted .pth file into Python site-packages via the document upload API.
Affected Products
- Papermerge Core 3.5.3
- Papermerge 3 deployments exposing the /api/documents/upload endpoint
- Python runtime environments backing Papermerge installations
Discovery Timeline
- 2026-10-05 - CVE-2026-105314 published to NVD
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-105314
Vulnerability Analysis
Papermerge is a Python-based document management system. The upload handler in papermerge/core/features/document/router.py accepts a client-controlled filename and derives a storage path using helpers from papermerge/core/pathlib.py. The path construction does not neutralize ../ traversal sequences before joining the filename to the storage root.
An authenticated standard user can submit an upload request where the filename contains traversal segments. The server then writes the uploaded bytes to a location of the attacker's choosing on the host filesystem, subject to the privileges of the Papermerge process.
The path from arbitrary file write to code execution relies on Python's startup behavior. Any .pth file placed in site-packages is parsed by the site module on interpreter startup. Lines beginning with import are executed as Python code. Writing a malicious .pth file therefore yields code execution when the Papermerge worker, scheduler, or interpreter restarts.
Root Cause
The root cause is improper neutralization of path traversal sequences in the upload filename before filesystem operations. The code concatenates user input into a destination path without canonicalization or validation that the resolved path remains within the intended storage directory.
Attack Vector
Exploitation requires network access to the Papermerge API and valid credentials for a standard user account. The attacker issues an authenticated POST to /api/documents/upload with a filename containing ../ segments that traverse into the Python site-packages directory of the Papermerge installation. The payload file uses the .pth extension and contains an import directive that executes attacker-controlled Python. Execution occurs on the next interpreter startup. Public proof-of-concept material is available in the kashishtopi cve-pocs repository and the accompanying write-up PDF.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-105314
Indicators of Compromise
- Unexpected .pth files appearing under the Python site-packages directory used by the Papermerge interpreter.
- Upload API requests to /api/documents/upload where the filename or multipart form fields contain ../, ..\\, or URL-encoded traversal sequences.
- Files written outside the configured Papermerge document storage root, especially under Python library paths or system directories.
- Python interpreter processes spawning unexpected child processes (shells, network utilities) shortly after service restart.
Detection Strategies
- Inspect web server and application logs for POST requests to /api/documents/upload with suspicious filename parameters containing traversal patterns.
- Deploy file integrity monitoring on site-packages and other Python import paths to alert on new or modified .pth files.
- Correlate Papermerge service restarts with subsequent anomalous process creation on the host.
Monitoring Recommendations
- Enable verbose request logging on the Papermerge API gateway or reverse proxy to retain full filename values.
- Monitor outbound network connections from the Papermerge host for callbacks consistent with reverse shells or command-and-control traffic.
- Audit account activity for standard users performing unusual volumes of upload requests or uploads at unusual hours.
How to Mitigate CVE-2026-105314
Immediate Actions Required
- Restrict network access to the Papermerge API so that only trusted users and networks can reach /api/documents/upload.
- Audit all standard user accounts and disable or reset credentials for accounts that are inactive or no longer required.
- Scan the Python site-packages directories on all Papermerge hosts for unauthorized .pth files and remove any that are not vendor-supplied.
- Review historical upload logs for filenames containing traversal sequences and triage affected hosts for post-exploitation activity.
Patch Information
No fixed version is listed in the NVD entry at the time of publication. Monitor the Papermerge Core GitHub repository for a security release addressing the upload path handling in router.py and pathlib.py. Upgrade to the fixed version as soon as it becomes available.
Workarounds
- Run the Papermerge process as an unprivileged user that lacks write permissions to Python site-packages and other sensitive directories.
- Deploy a reverse proxy or Web Application Firewall rule that rejects upload requests whose filename fields contain .., /, \\, or encoded equivalents.
- Mount the Python installation and site-packages directories read-only where the deployment model permits it.
- Isolate Papermerge in a container with a minimal writable filesystem footprint restricted to the intended document storage volume.
# Example WAF/nginx rule to block traversal patterns in upload filenames
location /api/documents/upload {
if ($request_body ~* "filename=\"[^\"]*(\.\.|%2e%2e)") {
return 400;
}
proxy_pass http://papermerge_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

