Repository navigation
feat(gas-station): enforce budget caps, geofencing, Turnstile CAPTCHA… - #1978
Open
Dev-Savio-hub wants to merge 1 commit into
Open
Dev-Savio-hub wants to merge 1 commit into
Dev-Savio-hub wants to merge 1 commit into
Conversation
… & 24h Redis anti-drain blacklist (BE-091)
|
@Dev-Savio-hub is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Dev-Savio-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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.
this pr closes #1838
Summary
Hardens the Stellar fee-sponsoring gas station against treasury drain attacks by enforcing strict transaction policies, daily per-student transaction & spending caps, geofencing, Turnstile CAPTCHA for unlinked wallets, and automatic 24-hour Redis blacklisting for abusive addresses.
Changes
SorobanAuthorizedInvocationvalidation.payment/non-contract ops and Sorobantransfer,transfer_from,transfer_muxed,clawback,burn,burn_frominvocations).GAS_STATION_DAILY_TX_CAP) with automatic refund on submission failure, alongside the existing daily USD/stroops spending quota.verifyTurnstileToken) for unlinked wallets.GAS_STATION_BLOCKED_COUNTRIES/GAS_STATION_ALLOWED_COUNTRIES) using proxy country headers.gas-station:blacklist:<address>, TTL 86400s) triggered when an address exceeds the rolling abuse threshold.gasStationPolicyGuardmiddleware onPOST /sponsorto reject geofenced regions, blacklisted wallets, and exhausted daily transaction caps before XDR parsing.turnstileTokeninPOST /sponsor, forwardedclientIpand country headers, and exposeddailyTransactionsusage inGET /quota.Verification
npx jest tests/gasStationService.test.ts --runInBand --forceExit— 7/7 tests passed.npx tsc --noEmit— 0 TypeScript errors in all modified/added files.