mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5916] [MERGED] fix(backend): enforce user ownership when deleting PAT #5411
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5411
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5916
Author: @mirarifhasan
Created: 2/28/2026
Status: ✅ Merged
Merged: 3/2/2026
Merged by: @jamesgeorge007
Base:
patch← Head:fix/security-advisory-GHSA-7pfq-mwj3-xw9h📝 Commits (3)
7134624fix: enforce user ownership when deleting PAT36dc583chore: validate PAT id; use deleteMany in serviceac8c021test(backend): add cross-user ownership test fordeletePAT📊 Changes
3 files changed (+55 additions, -17 deletions)
View changed files
📝
packages/hoppscotch-backend/src/access-token/access-token.controller.ts(+8 -2)📝
packages/hoppscotch-backend/src/access-token/access-token.service.spec.ts(+38 -8)📝
packages/hoppscotch-backend/src/access-token/access-token.service.ts(+9 -7)📄 Description
Closes BE-727
What's changed
This PR closing security advisory:
https://github.com/hoppscotch/hoppscotch/security/advisories/GHSA-7pfq-mwj3-xw9h
Require the authenticated user's UID when deleting a personal access token. The controller now injects
GqlUserand forwardsuser.uidtoAccessTokenService.deletePAT; the service signature was updated to acceptuserUidand restrict thedeletequery to{ id, userUid }to prevent deleting tokens belonging to other users. Tests were updated to pass the user UID.Notes to reviewers
Nil
Summary by cubic
Enforces user ownership and validates input when deleting a personal access token to prevent cross-user or invalid deletions. Fixes GHSA-7pfq-mwj3-xw9h and closes BE-727.
Written for commit
ac8c0217b8. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.