Repository navigation
Todo
Labels
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:sponsordSponsorship daemon, onramp and installers (crates/sponsord*)kind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduled
Description
1. The onramp gate page can be framed, so other sites' visitors solve the captcha for an attacker's keys
crates/sponsord-onramp/src/http/fund.rs:19-27returns bareHtml;src/http/mod.rs:18-27adds no security-header layer; noframe-ancestors/X-Frame-Optionsanywhere in the crate.assets/turnstile.html:30-37auto-POSTs/v1/fundfor whateverclientis in the URL; the Turnstile checks (src/gate/turnstile.rs:146-161, hostname + action) pass for a framed copy of the page.- Attack: an attacker site iframes
https://onramp/fund?client=0xA_nwith a fresh key per visitor; Turnstile's managed mode passes most real browsers non-interactively; the attacker polls the capability out of the publicGET /v1/capability?client=…(src/http/capability.rs:18-41). Per-IP limits don't bind — every visitor brings their own IP. Cash-out is self-dealing: publish content only the attacker's bonded node holds and pull it with the farmed keys; the keeper refills the pool from the treasury (keeper.rs:230-233, default $100/h) until the wallet is empty. - (Framing behavior of the Turnstile widget inside a nested iframe is plausible, not proven; the missing headers are confirmed.)
- Send
Content-Security-Policy: frame-ancestors 'none'andX-Frame-Options: DENYon every onramp response - Bind the Turnstile token to the client key via
cdata - Consider a global daily issuance budget in the daemon (per-IP limits are not a spend bound)
2. decdn gateway: any web page can drain the user's * capability via a cross-site navigation
crates/cli/src/gateway/site.rs:181-203—may_spendallows "a top-level navigation from anywhere".gateway.rs:1483-1486+site.rs:64-66— the site host is<hash32>.localhost:<port>(port included), whilevalid_host(gateway.rs:702-717) rejects:, so no host-specific scope can ever match a site host — in practice only aScope::Any(*) capability pays for bundle sites. Same-origin/_decdn/<hash>requests are then paid (gateway.rs:1501-1513).- Attack: with a
*capability registered (required for sites to work), any web page setslocation = "http://<b32(B)>.localhost:8484/"(default port,crates/common/src/cli/gateway.rs:18) for an attacker bundle whoseindex.htmlloopsfetch('/_decdn/<big attacker-held blob>')— each fetch is same-origin, allowed, and paid to the attacker's provider, up to the capability's cap. - Gate a site's first paid request on
Sec-Fetch-Site: same-origin/none, or show a click-through interstitial - Give site hosts their own budget instead of falling through to
* - Fix the host:port mismatch so a bundle's own scope can pay for its site
3. The shipped env example invites a spoofable client-IP header
deploy/sponsord/sponsord-onramp.env.example:24-27setsONRAMP_CLIENT_IP_HEADER=X-Forwarded-Forand says nginx appends to it. nginx only appends with an explicitproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; by default the client's own header passes through, so the rightmost value is attacker-chosen (src/net.rs:46-54) — a fresh "IP" per request bypasses the fund/poll rate limits and spoofs Turnstileremoteip.- Document the exact nginx directive, or prefer
X-Real-IP/CF-Connecting-IPset by the proxy
4. Gateway PUT /_capability doesn't check who minted the delegate; delegate slots are exhaustible (partly speculative)
crates/cli/src/gateway.rs:1735-1749— the grant is attached bydelegates.get_mut(&grant.signer)with nodelegate.site == caller.site()check, so a page that learns another caller's delegate address and capability can attach it first under its own scope.gateway.rs:215—MAX_PAGE_DELEGATES = 1024can be filled by ~128 sites on public-suffix domains, denying minting to every other page for 15 min.- Bind delegates to the minting site; per-site delegate quota
Also worth fixing while here (informational): docs/sponsord/security.md:73-75 understates a malicious onramp — it serves the curl | sh installer, i.e. arbitrary code on the user's machine, not just "a different pool or release pin"; and the sponsord image binds 0.0.0.0:8090 (Dockerfile:94,97) with an unauthenticated /metrics, so a stray -p 8090:8090 exposes pool balances.
Metadata
Metadata
Assignees
Labels
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:sponsordSponsorship daemon, onramp and installers (crates/sponsord*)kind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduled
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsBacklog
Activity
fix: cap manifest fetches, clamp outboard reads, and small hardening (#…
yigitdot commentedon Nov 26, 2026
Status on
main(e720fbb):Content-Security-Policy: frame-ancestors 'none'andX-Frame-Options: DENYon every onramp response (crates/sponsord-onramp/src/http/mod.rs).cdatabinding and no daily issuance budget."any"or namespaces). A top-levelGETnavigation still passes from any site (gateway/site.rs,browser_gate), and site hosts count as the gateway's own origins (commands/gateway.rs), so a site's same-origin fetches can spend an"any"capability. The host:port scope mismatch is moot, since scopes are now namespaces, not hosts.deploy/sponsord/sponsord-onramp.env.examplestill names nginx as a proxy that appendsX-Forwarded-For, without theproxy_set_headerdirective.security.mdwording and the0.0.0.0:8090bind inDockerfileare unchanged.alpergundogdu commentedon Nov 26, 2026
#3011 covers §3: the env example now names nginx's
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;directive.fix(sponsord-onramp): spread untracked clients over overflow windows (#…
fix(sponsord-onramp): bind the Turnstile token to the client key (#3028)