/

CVE-2026-85687

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-73) in Surya Screenshot Server

CVE-2026-85687

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Unauthenticated Arbitrary File Read

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Surya's screenshot server accepts client-controlled file paths without adequately restricting which local files can be opened. An unauthenticated attacker may read image or PDF contents from the host, receive rendered data in base64, and use an information endpoint to determine whether files exist.

Affected context

The vulnerability occurs in screenshot-server deployments that expose the /info, /page, or /process routes and pass raw file_path parameters to image or PDF processing libraries. Risk is highest when the service is reachable by untrusted users and its process can access sensitive files or directories on the host.

Exploit preconditions

  • Attack surface: Network-accessible screenshot server HTTP routes
  • Required access: No authentication may be required when the affected routes are exposed
  • Trigger point: A request containing a client-controlled file path
  • Why exploitation is possible: The supplied path can influence local file-opening operations without a sufficiently restrictive directory boundary or file authorization check

Why this happens

The underlying bug is external control of a file name or path, mapped to CWE-73. Application input is treated as a trusted filesystem reference and passed to image or PDF readers without reliably constraining it to approved files, directories, or resource identifiers. Rendering and existence-check behavior can then disclose file contents or filesystem state.

Potential impact

  • Sensitive images or PDF documents may be disclosed
  • Encoded rendered content could be returned to an attacker
  • File existence and deployment details may be exposed
  • Application secrets or operational documents could be read if accessible to the service account
  • Disclosed information could support further compromise

General mitigation guidance

Mitigation generally focuses on removing direct trust in client-supplied filesystem paths.

Common defensive patterns include:

  • Resolve user requests through opaque server-side resource identifiers rather than raw paths
  • Enforce canonical-path checks against narrowly scoped, approved directories
  • Apply allowlists for permitted files, formats, and processing locations
  • Reject symbolic-link escapes, alternate path representations, and unexpected path components
  • Require authentication and authorization before file-processing operations
  • Run the service with a dedicated least-privileged account and minimal filesystem access
  • Return generic errors that do not reveal filesystem existence or processing details

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules identifying request parameters passed to file-opening APIs
  • Code review checks for raw path parameters, missing canonicalization, and incomplete authorization
  • Tests that verify access is confined to approved resource directories and that symlink or path-encoding variants are rejected
  • Web application firewall or API policy rules restricting file-path parameters and requiring authentication
  • Runtime monitoring for unusual requests to file-processing routes and repeated existence-check behavior

Automated security review tools may help identify data flows from HTTP inputs to filesystem or document-processing APIs.

Sources

SourceLink
github.comgithub.com/datalab-to/surya
github.comgithub.com/datalab-to/surya/blob/v0.22.1/surya/scripts/screenshot_app.py
github.comgithub.com/datalab-to/surya/issues/518
vulncheck.comvulncheck.com/advisories/surya-0.22.1-unauthenticated-arbitrary-file-read-via-screenshot-server

Frequently asked

questions

Yes, when the screenshot server routes are network-accessible and do not require authentication. Exploitability still depends on the service's filesystem permissions and deployment exposure.

Not necessarily. The described routes accept requests without authentication, although network controls or an authentication layer may limit access in some deployments.

Do not accept raw filesystem paths from clients. Use authorized server-side resource identifiers and enforce canonical, allowlisted directory boundaries before any file is opened.

Combine strict path validation with authorization, least-privilege service accounts, restricted filesystem access, negative testing for path variants, and monitoring of file-processing endpoints.

Find out what's already
exploitable in your codebase.