Skip to content

fix(users): self-check on PATCH stellar-address + controller spec - #677

Open
yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/users-self-check-597
Open

yggdrasilworld wants to merge 1 commit into
MergeFi:mainfrom
yggdrasilworld:fix/users-self-check-597

Conversation

@yggdrasilworld

Copy link
Copy Markdown

What

PATCH /users/:id/stellar-address took the URL id with no self-check — any authenticated user could set ANY user's stellar-address (the on-chain payout recipient), a payout-hijack hole. The #39 check was missing.

Fix

Enforce id === req.user.userId → 403 otherwise. Plus the missing controller-spec covering delegation + the 403.

Resolves #597

PATCH /users/:id/stellar-address took the URL id with no self-check — any
authenticated user could set ANY user's stellar-address (the on-chain
payout recipient), a payout-hijack hole. Enforce id === the JWT caller.

Also adds the missing users.controller spec (delegation + the 403).

Resolves MergeFi#597 + the missing MergeFi#39 self-check
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@yggdrasilworld

Copy link
Copy Markdown
Author

Ready for review — a real auth-hole: PATCH /users/:id/stellar-address had no self-check, so any authenticated user could set anyone's payout-address → misdirected funds. This adds the caller-owns-the-target check.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

users/users.controller.ts has no spec file

1 participant