Summary
PlaywrightCapture contained a server-side request forgery (SSRF) issue in how it handled navigations and resource requests initiated by rendered pages.
When processing attacker-controlled URLs, a malicious page could redirect the capture browser to internal network addresses or local files, potentially exposing sensitive responses through screenshots, saved content, or logs.
Affected context
This vulnerability affects deployments where PlaywrightCapture is:
- Used as a web page capture or rendering service (e.g., screenshotting, HTML archiving)
- Exposed to or used with untrusted or user-supplied URLs
- Running in an environment that has network access to internal services, metadata endpoints, or other non-public IP ranges, or has access to local files
The risk materializes when captured pages can trigger navigations or resource loads that the service does not restrict, allowing indirect access to internal or local resources.
Exploit preconditions
- Attack surface: HTTP(S) endpoint or workflow that instructs PlaywrightCapture to open and capture a given URL.
- Required access: Ability to submit or influence the URL that PlaywrightCapture will process (e.g., via API, web form, job queue, or automated pipeline).
- Trigger point: The captured page executes browser-side navigation or resource loading mechanisms (for example,
window.location.href, meta refresh, or JavaScript-based redirects) that cause the Playwright browser to request new URLs. - Why exploitation is possible: The capture process did not sufficiently restrict or validate these subsequent navigations and resource requests, allowing requests to
file://URLs or non-public IP ranges (loopback, link-local, or internal addresses).
Why this happens
The underlying issue stems from insufficient validation and restriction of outbound browser requests initiated during page rendering.
While the initial URL might be controlled or filtered, internal navigation events and resource loads from within the page were trusted by default.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where a server-side component (here, a headless browser controlled by PlaywrightCapture) can be coerced into making arbitrary requests to internal or non-public endpoints.
The architectural pattern of "render whatever the page asks for" without enforcing network or scheme-level allowlists enables attackers to pivot from external inputs to internal resources and local files.
Potential impact
- Access to internal HTTP services that are not directly exposed to the internet (e.g., admin dashboards, internal APIs, metadata endpoints).
- Interaction with loopback or link-local services running on the capture host, potentially influencing local daemons or control planes.
- Attempted access to local files via
file://URLs from the capture environment, reading configuration files, logs, or other sensitive data if subsequently captured. - Leakage of internal or local resource content through:
- Screenshots of pages served from internal endpoints
- Stored HTML or DOM dumps
- Text or network logs generated as part of the capture process
- Other capture artifacts that include rendered responses
- Use of the capture service as an internal network oracle, assisting attackers in mapping internal services and behaviors.
General mitigation guidance
Effective mitigation focuses on constraining where the capture browser is allowed to navigate and what it can fetch:
- Introduce network-layer egress controls for the capture environment, such as firewall rules or container network policies that block access to:
- 127.0.0.0/8 and other loopback addresses
- Link-local ranges (e.g., 169.254.0.0/16)
- Private RFC1918 address ranges unless explicitly required
- Cloud provider metadata endpoints and control APIs
- Apply URL and scheme allowlists inside the capture logic:
- Permit only
http://andhttps://schemes where appropriate - Deny
file://,ftp://,gopher://, and other sensitive schemes from both initial and subsequent navigations. - Treat all in-page navigations and resource loads as untrusted input:
- Enforce the same domain and network restrictions on redirects, iframes, and subresource loads as on the initial URL.
- Reduce exposure of sensitive data through capture outputs:
- Avoid including raw response bodies or headers from internal services in user-visible artifacts.
- Minimize or sanitize logs that might capture internal URLs or content.
- Run the capture service under least privilege:
- Use an isolated account or container with restricted filesystem access.
- Avoid mounting sensitive directories or credentials into the capture environment.
How teams detect issues like this
Detection typically involves both code-level and operational monitoring approaches:
- Code and configuration review:
- Look for capture or rendering components that accept untrusted URLs without explicit network restrictions.
- Identify use of headless browsers (e.g., Playwright, Puppeteer) that lack sandboxing of outbound requests or scheme filtering.
- Check for missing allowlists/deny-lists for IP ranges, schemes, and hostnames within navigation and request interception hooks.
- Static analysis and policy enforcement:
- Use SAST rules or custom linting to flag components that:
- Accept user-controlled URLs and pass them directly to browser automation frameworks.
- Do not apply URL normalization and validation before navigation.
- Enforce security policies in CI/CD requiring review of any code introducing URL-based capture or rendering services.
- Network and runtime monitoring:
- Monitor outbound traffic from the capture environment for:
- Requests to local or private ranges
- Access to metadata and control-plane endpoints
- Set alerts for unusual access patterns or spikes in internal requests originating from the capture system.
- Security testing:
- Include SSRF-focused tests as part of regular application security assessments, using controlled internal endpoints to detect if they can be reached via the capture service.

