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.

