VAITP Dataset

← Back to the dataset

CVE-2026-105314

Remote RCE in Papermerge 3.5.3 via /api/documents/upload directory traversal.

  • CVSS 7.5
  • CWE-24
  • Input Validation and Sanitization
  • Remote

Papermerge 3.5.3 allows remote code execution by a standard user via directory traversal in a /api/documents/upload call. A Python .pth file can be written to site-packages, and its code is executed upon the next start of the Python interpreter.

CVSS base score
7.5
Published
2026-10-05
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Assignment
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Path Traversal
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade Papermerge to version 3.5.4 (or later), which patches the directory‑traversal RCE vulnerability.

Vulnerable code sample

import os
from pathlib import Path

def save_uploaded_file(upload_dir: str, filename: str, content: bytes) -> Path:
    """
    Store an uploaded file under `upload_dir`.
    """
    # VULNERABLE: writes file using unvalidated filename, allowing directory traversal
    target_path = Path(upload_dir) / filename
    os.makedirs(target_path.parent, exist_ok=True)
    with open(target_path, "wb") as f:
        f.write(content)
    return target_path

Patched code sample

import os
from pathlib import Path

def save_uploaded_file(upload_dir: str, filename: str, content: bytes) -> Path:
    """
    Store an uploaded file under `upload_dir`.
    """
    # FIX: normalize path and reject traversal outside upload_dir
    normalized = os.path.normpath(filename)
    if normalized.startswith("..") or os.path.isabs(normalized):
        raise ValueError("Invalid filename")
    target_path = Path(upload_dir) / normalized
    os.makedirs(target_path.parent, exist_ok=True)
    with open(target_path, "wb") as f:
        f.write(content)
    return target_path

Cite this entry

@misc{vaitp:cve2026105314,
  title        = {{Remote RCE in Papermerge 3.5.3 via /api/documents/upload directory traversal.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-105314},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-105314/}}
}

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.