mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5897] [MERGED] fix(backend): resolve security advisories for IDOR and onboarding bypass #5402
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#5402
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/5897
Author: @mirarifhasan
Created: 2/22/2026
Status: ✅ Merged
Merged: 2/23/2026
Merged by: @jamesgeorge007
Base:
next← Head:fix/be-security-advisories📝 Commits (4)
e366079fix: prevent re-running onboarding; restrict env edits3dc318dtest: fix user environment test casesaaa52edfix(backend): improve error handling in onboarding status check843da99refactor(backend): extract inline error string and add missing JSDoc param📊 Changes
6 files changed (+77 additions, -10 deletions)
View changed files
📝
packages/hoppscotch-backend/src/errors.ts(+14 -0)📝
packages/hoppscotch-backend/src/infra-config/infra-config.service.ts(+12 -7)📝
packages/hoppscotch-backend/src/infra-config/onboarding.controller.ts(+19 -0)📝
packages/hoppscotch-backend/src/user-environment/user-environments.resolver.ts(+2 -0)📝
packages/hoppscotch-backend/src/user-environment/user-environments.service.spec.ts(+19 -0)📝
packages/hoppscotch-backend/src/user-environment/user-environments.service.ts(+11 -3)📄 Description
Closes BE-717 BE-718
Fixes GHSA-jwv8-867r-q9fg
Fixes GHSA-72rv-vc3j-5vqr
What's changed
This PR addresses multiple security advisories by enforcing proper authorization checks.
The
canReRunOnboardingflag being tied tousersCount === 0means the endpoint is only accessible when no users exist, so both the initial setup window and the re-run scenario are covered by the same guarantee. There's nothing meaningful to compromise in either case, and once the first user signs up it locks permanently.On the other points from the report — the missing JWT/admin guard is intentional, since auth providers don't exist during initial setup and requiring auth to configure auth isn't feasible. The ask around guarding all
/v1/onboarding/*endpoints also doesn't apply —GET /statushas to stay public for the frontend to know whether to show the onboarding screen, andGET /configis already token-gated.Additionally,
getOnboardingStatus()previously always returned a success value, making the downstreamE.isLeftcheck dead code. Wrapped in atry-catchso fetch failures now return a proper error and surface as HTTP 422.Notes to reviewers
Nil
Summary by cubic
Fixes two security issues: blocks unauthorized onboarding re-runs and removes an IDOR in user environment mutations. Addresses GHSA-jwv8-867r-q9fg, GHSA-72rv-vc3j-5vqr, GHSA-57c6-hq5p-rgjq; completes BE-717 and BE-718.
Written for commit
843da99fbc. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.