Skip to content

fix: require authentication on GET /demo/registered-users (CVE-2026-45248)#6076

Open
Christbowel wants to merge 1 commit into
hashgraph:mainfrom
Christbowel:fix/cve-2026-22203-demo-registered-users-auth
Open

fix: require authentication on GET /demo/registered-users (CVE-2026-45248)#6076
Christbowel wants to merge 1 commit into
hashgraph:mainfrom
Christbowel:fix/cve-2026-22203-demo-registered-users-auth

Conversation

@Christbowel
Copy link
Copy Markdown

@Christbowel Christbowel commented May 14, 2026

The GET /api/v1/demo/registered-users endpoint was publicly accessible without authentication, exposing all registered user accounts (usernames, DIDs, roles, policy assignments).

Changes

api-gateway/src/api/service/demo.ts

  • Added @Auth(Permissions.DEMO_KEY_CREATE) guard to registeredUsers(), matching the sibling /random-key and /push/random-key endpoints
  • Injected @AuthUser() to pass authenticated user context
  • Updated InternalException call to use user.id instead of null

e2e-tests/cypress/e2e/api-tests/001_demo/getRegisteredUsers.cy.js

  • Updated positive test to authenticate via Authorization.getAccessToken()
  • Added negative tests: no token, invalid token, empty token → expect 401 UNAUTHORIZED

References

  • CVE-2026-45248
  • CWE-306 (Missing Authentication for Critical Function)

@Christbowel Christbowel requested review from a team as code owners May 14, 2026 13:28
…2203)

Signed-off-by: christbowel <0xdeadbeef@christbowel.com>
@Christbowel Christbowel force-pushed the fix/cve-2026-22203-demo-registered-users-auth branch from 21a17f8 to f58b599 Compare May 14, 2026 13:32
@Christbowel Christbowel changed the title fix: require authentication on GET /demo/registered-users (CVE-2026-22203) fix: require authentication on GET /demo/registered-users (CVE-2026-45248) May 15, 2026
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.

1 participant