Skip to content

httpoverrpc/client: add CSRF protection to the proxy listener - #644

Open
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
ikryvanos/httpoverrpc-proxy-csrf
Open

httpoverrpc/client: add CSRF protection to the proxy listener#644
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
ikryvanos/httpoverrpc-proxy-csrf

Conversation

@sfc-gh-ikryvanos

Copy link
Copy Markdown
Collaborator

The proxy subcommand runs a local HTTP listener that forwards requests to a remote host using the operator's ambient authorization. A page open in the operator's browser could otherwise silently drive requests through it (cross-site request forgery).

Reject requests a browser marks as Sec-Fetch-Site: cross-site, and require any supplied Origin to match the listener's Host. Top-level navigation and same-origin requests are unaffected, and non-browser clients (curl, scripts) send neither header. A --skip-csrf-protection flag opts out for unusual setups. Also stop forwarding hop-by-hop headers to the target.

The `proxy` subcommand runs a local HTTP listener that forwards requests to
a remote host using the operator's ambient authorization. A page open in the
operator's browser could otherwise silently drive requests through it
(cross-site request forgery).

Reject requests a browser marks as Sec-Fetch-Site: cross-site, and require
any supplied Origin to match the listener's Host. Top-level navigation and
same-origin requests are unaffected, and non-browser clients (curl, scripts)
send neither header. A --skip-csrf-protection flag opts out for unusual
setups.
@sfc-gh-ikryvanos
sfc-gh-ikryvanos force-pushed the ikryvanos/httpoverrpc-proxy-csrf branch from d66711e to 63d4361 Compare August 20, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant