Skip to content

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

Closed
yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/users-self-check-597
Closed

yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/users-self-check-597

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

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

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

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.

setStellarAddress is sync — the ForbiddenException escapes expect() as a
throw, not a rejection; and the prior test's jest.fn() leaked a recorded
call into the not.toHaveBeenCalled assertion.
The shared base carried half-written merge artifacts: an orphaned
invokeOnLockedEscrow block in escrow.service.ts, duplicated returns plus
a dead parsePagination in sponsors.controller.ts, and missing
describe/it closers in github-webhooks.service.spec.ts. Aligned each
with the intended form so the branch typechecks and its specs load.
@yggdrasilworld
yggdrasilworld deleted the fix/users-self-check-597 branch October 19, 2026 02:34
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