flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Backend] GET /v1/users/:publicKey/events has no auth, letting anyone enumerate a wallet's history

Open K1NGD4VID opened this issue 2 months ago • 8 comments

Labels: backend, bug, security, third-wave-audit File/location: backend/src/routes/v1/user.routes.ts:185 (router.get('/:publicKey/events', getUserEvents)), backend/src/controllers/user.controller.ts:116-169 (getUserEvents)

Description: Unlike GET /v1/events (which requires requireAuth and rejects any address other than the caller's own publicKey, per the fix for #825), the sibling endpoint GET /v1/users/:publicKey/events has no auth middleware at all and performs no ownership check — any unauthenticated caller can pass an arbitrary Stellar public key and retrieve that wallet's full paginated stream-event history (amounts, counterparties, timestamps), enabling wallet activity/financial surveillance.

Acceptance Criteria:

  • [ ] GET /v1/users/:publicKey/events requires authentication
  • [ ] The endpoint rejects (403) requests where the authenticated caller's publicKey does not match the :publicKey path param, mirroring the check already applied to GET /v1/events
  • [ ] A regression test asserts an unauthenticated request is rejected and an authenticated request for a different wallet's publicKey is rejected

Notes: This is the same vulnerability class fixed for GET /v1/events under #825, and is likely part of the divergence already noted by closed issue #1271 ('Duplicated "list events for a wallet" implementations with divergent feature sets') — but that issue's title does not call out the missing auth check specifically, and the auth gap is still live on this endpoint. See also GET /v1/users/:publicKey (getUser) and GET /v1/streams/summary/:address (getUserStreamSummary), which are also unauthenticated but expose comparatively less sensitive aggregate/public data by design.

K1NGD4VID avatar Sep 27 '26 21:09 K1NGD4VID

Hi maintainers,

I reviewed this issue and would like to contribute the fix.

Implementation approach:

  1. Audit authorization boundaries and enforce defensive validation barriers.
  2. Implement multi-role permission checks and invocation validation.
  3. Write adversarial unit tests simulating edge failure modes and invalid callers.
  4. Ensure zero regressions across existing test suites and CI workflows.

I can deliver a clean, tested PR within 24 hours. Please assign!

Ranjeet2063 avatar Oct 04 '26 19:10 Ranjeet2063

@OmniZlatoon has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Good morning my Maintainer. Can I borrow this issue sir? I'll repay by doing a fine work getting the job done. My ETA is 3 hours

ℹ️ Repo Maintainers: To accept this application, review their application or assign @OmniZlatoon to this issue.

OmniZlatoon avatar Oct 18 '26 03:10 OmniZlatoon

@innocentharuna has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hey maintainer, please kindly assign this to me, i can surely fix it

ℹ️ Repo Maintainers: To accept this application, review their application or assign @innocentharuna to this issue.

innocentharuna avatar Oct 18 '26 03:10 innocentharuna

@Teejay2696 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi maintainer, I can fix this kindly assign

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Teejay2696 to this issue.

Teejay2696 avatar Oct 18 '26 03:10 Teejay2696

@CollinsKRO has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi Maintainer, I can fix this pls assign. ETA 5hrs

ℹ️ Repo Maintainers: To accept this application, review their application or assign @CollinsKRO to this issue.

CollinsKRO avatar Oct 18 '26 03:10 CollinsKRO

@fadesany has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello maintainer, i would like to work on this issue

ℹ️ Repo Maintainers: To accept this application, review their application or assign @fadesany to this issue.

fadesany avatar Oct 18 '26 03:10 fadesany

Congratulations, @fadesany! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

🧑‍💻 @fadesany: 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 🌊

drips-wave[bot] avatar Oct 18 '26 03:10 drips-wave[bot]

This issue has been completed by @fadesany as part of the Stellar Wave Program's 10th Wave 🥳

😎 @fadesany: 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.

drips-wave[bot] avatar Oct 18 '26 04:10 drips-wave[bot]