Summary
Paperclip in its default local_trusted mode does not adequately validate Host headers, allowing DNS rebinding to bypass assumptions about trusted local requests. If a developer visits a malicious webpage while running Paperclip locally, the page may cause authenticated API requests that execute arbitrary commands through the process adapter.
Affected context
The vulnerability occurs in Paperclip deployments using the default local_trusted mode, where local API requests receive elevated trust without sufficiently verifying the request's Host header. The risk is greatest when a developer runs the service locally, has an active authenticated session, and visits untrusted web content in the same browser environment.
Exploit preconditions
- Attack surface: Paperclip's locally exposed authenticated API
- Required access: A victim developer must be running Paperclip locally and typically have an authenticated session
- Trigger point: A malicious webpage causes browser requests while DNS rebinding changes a permitted hostname to resolve to the local Paperclip service
- Why exploitation is possible: The local_trusted mode relies on an insufficiently validated Host header and may authorize requests that originate from an untrusted webpage
Why this happens
The underlying bug is an authorization failure caused by trusting a client-controlled Host header to distinguish trusted local requests. Because the service does not robustly bind authorization decisions to an authenticated and explicitly trusted origin, DNS rebinding can make attacker-controlled browser activity appear to target an allowed local endpoint. This behavior maps to CWE-862: Missing Authorization, in which a sensitive operation lacks an effective authorization check before execution.
Potential impact
- An attacker could execute arbitrary commands through the process adapter
- A victim's local development environment may be compromised
- Local source code, credentials, or configuration data could be exposed
- Malicious actions could alter files, build artifacts, or development services
- Compromise could enable further access to systems reachable from the developer workstation
General mitigation guidance
Mitigation generally focuses on removing implicit trust from local HTTP requests and ensuring every sensitive operation has an independent authorization decision.
Common defensive patterns include:
- Avoiding Host-header-only authorization and validating the complete request context
- Requiring explicit authentication and authorization for command-execution APIs
- Restricting listener exposure to the narrowest necessary interface
- Using explicit origin controls, anti-CSRF protections, and secure browser-facing session policies where applicable
- Separating command execution from broadly reachable development APIs
- Running the process adapter with least privilege and limiting filesystem and network access
- Treating local development services as untrusted when they are reachable by browser content
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis and code review rules identifying authorization decisions based only on Host or other client-controlled headers
- Review of local-trusted modes that expose authenticated APIs without explicit origin and request validation
- Tests that evaluate DNS rebinding, cross-origin browser requests, and unauthenticated access to command-execution endpoints
- Runtime monitoring for unexpected local API requests or process-adapter invocations
- Policy enforcement requiring authentication, origin validation, and least-privilege execution for developer services
Automated security review tools may help identify missing authorization checks, although deployment-specific testing remains important.

