
Proof-of-concept for CVE-2026-105314: authenticated path traversal in Papermerge's upload API enabling arbitrary file write and root code execution via a .pth payload.
CVE-2026-105314
Papermerge is a self-hosted document manager. The document upload API builds the
storage path from the uploaded filename and does not remove path traversal. Any
authenticated user with the standard "user" role can upload a file whose multipart
filename contains ../ sequences. The server then writes the file outside its media
directory, with content the attacker controls. The official Docker image runs as
root, so an attacker can write a Python .pth file into site-packages and gain
code execution as root at the next interpreter start.
POST /api/documents/uploadpoc.py sends two uploads with a low-privilege bearer token:
media_root with a traversal filename (proves arbitrary write)..pth payload into the Python site-packages for code execution on the next start.Run:
python3 poc.py http://TARGET:PORT <BEARER_TOKEN>
Get the bearer token from a normal logged-in "user" account. Adjust the
site-packages path in the script to match the target. A successful write
returns HTTP 201.
This proof of concept is for authorized security testing and education only. Test only systems that you own or have explicit permission to test. The author takes no responsibility for misuse.