Repository navigation
fix(sponsord-onramp): bind the Turnstile token to the client key - #3028
Merged
Merged
Conversation
The gate page sets the widget's cdata to the client key in its URL, and
TurnstileGate refuses a siteverify answer whose cdata does not parse to
the client of the request. A custom ONRAMP_GATE_TEMPLATE must carry
{{CDATA}}, checked at startup like {{ACTION}}.
docs/sponsord/security.md states the keeper's top-up rate as the
treasury spend bound and why per-address limits are not one, that a
malicious onramp runs arbitrary code through the installer, and that
the sponsord image's port (unauthenticated /metrics) stays private.
Refs #2772
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2772 (§1b, §1c and the informational items; §2 is the gateway PR).
What changes
data-cdatato the client key from its URL (new{{CDATA}}placeholder).TurnstileGate::verifyrefuses a siteverify answer whosecdatadoes not parse to the request's client, alongside the hostname and action checks. A0xaddress is 42 alphanumerics, inside Turnstile's cdata limit (255 chars of[A-Za-z0-9_-]).ONRAMP_GATE_TEMPLATEmust carry{{CDATA}}; the onramp refuses to start without it, as it does for{{ACTION}}. Operators with a custom template adddata-cdata="{{CDATA}}"to the widget. This is operator config, not an installer or HTTP API contract.docs/sponsord/security.mdstates the keeper's top-up rate (oneSPONSORD_POOL_REFILL_MICRO_USDCperSPONSORD_POOL_WATCH_INTERVAL_SECS, $100/h by default, plus one per restart) as the treasury spend bound, and why per-address limits are not one. No daily issuance budget.curl | shinstaller. Thesponsordimage keeps0.0.0.0:8090(other containers must reach it); the Dockerfile comment and the hardening checklist say the port, which serves unauthenticated/metricswith pool balances, must never be published publicly.Tests
{{CDATA}}is refused at startup; the page carriesdata-cdata.cargo nextest run -p sponsord-onramp -p sponsord -p sponsord-e2e: 91 passed.cargo clippy --workspace --all-targets --all-features: clean.cargo fmt --check: clean.🤖 Generated with Claude Code