[Security] Stop accepting wallet secret keys over the API in stream cancel
Overview & Background
POST /v1/streams/:streamId/cancel requires the caller to POST their Stellar secret key in the JSON body (senderSecret). The backend then reconstructs the keypair and signs the transaction server-side. Secret keys transit the API, live in server memory, and are exposed to logs, proxies, and any compromised host. This also contradicts the project's own stated direction of client-side signing (sorobanService.ts deprecation note: "deprecating backend keeper signing in favour of client-side signing").
Technical Specification & Architecture
- Remove
senderSecretfrom the cancel contract:backend/src/controllers/stream/cancel.ts:85-90currently validates and forwardsreq.body.senderSecret.backend/src/services/sorobanService.ts:314-318(submitContractCall) acceptssenderSecret: stringand callsKeypair.fromSecret(senderSecret).
- Route cancel through the existing unsigned-XDR flow used by
/v1/streams/simulateso the browser wallet signs, or sign with the server keeper key the waytopUpStreamdoes. - Reject and purge any legacy
senderSecretfield immediately (400 with a clear migration message), and scrub historical log lines if any were recorded.
Target Files
backend/src/controllers/stream/cancel.tsbackend/src/services/sorobanService.tsbackend/src/routes/v1/streams/cancel.ts
Acceptance Criteria
- [ ] No endpoint accepts a Stellar secret key in request body, query, or headers.
- [ ] Cancel flow produces a signed transaction without the backend ever seeing a user secret key.
- [ ]
submitContractCallno longer takessenderSecret; legacy callers are removed. - [ ] Regression test asserts that a
senderSecretfield is rejected.
@OlamideAdesina has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi maintainer, I can get this issue fixed quickly. Please assign it to me
âšī¸ Repo Maintainers: To accept this application, review their application or assign @OlamideAdesina to this issue.
Congratulations, @OlamideAdesina! đ Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
đ§âđģ @OlamideAdesina: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
đ¤ Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
đ Happy Wave đ
This issue has been completed by @OlamideAdesina as part of the Stellar Wave Program's 11th Wave đĨŗ
đ @OlamideAdesina: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
đ§âđģ Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.