You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enforce Authentication and Validation on Fee Sponsorship Route #330
The /api/sponsor endpoint (app/api/sponsor/route.ts) provides gasless transaction support by wrapping client transactions in a Stellar FeeBumpTransaction signed with the platform's ADMIN_SECRET_KEY.
Currently, this endpoint does not enforce session authentication or role authorization via requireAuthenticatedUser(). Furthermore, it does not inspect the operations inside the inner transaction XDR to verify that the target is a legitimate TrustLend protocol contract or valid platform operation. As a result, arbitrary unauthenticated requests could request fee bumps for unrelated Stellar transactions, depleting the platform treasury's XLM reserves.
Acceptance Criteria
Require authenticated borrower sessions via requireAuthenticatedUser("borrower").
Validate the inner transaction XDR to ensure it targets official TrustLend smart contracts or approved protocol operations before wrapping.
Implement strict per-user and per-wallet rate limits for fee sponsorship requests.
Ensure proper error handling and logging for unauthorized or malformed sponsorship attempts.
@Faymorce has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
Hi Maintainer, I’ve looked through the issue and understand what needs to be done. I’m confident I can work on it successfully. Please consider assigning it to me.
Activity
Faymorce commentedon Oct 21, 2026
@Faymorce has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Faymorce to this issue.
huangji6693-max commentedon Oct 26, 2026
Submitted PR #461 implementing borrower session authentication (
requireAuthenticatedUser("borrower")), inner transaction XDR contract/operation validation (validateSponsoredTransactionXdr), per-user and per-wallet rate limiting (enforceSponsorRateLimit), and unit tests (app/api/sponsor/route.test.ts).