Service user with role User can view all setup keys via API #1231

Open
opened 2025-11-20 05:26:40 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @alexcupertme on GitHub (Sep 11, 2024).

Describe the problem

Service user with role User can view all setup keys via API. This is a huge critical problem, because it is a secret, which should be provisioned to the app using it once, and should be shown once we created it, not every time and EVEN WORSE - NOT all secrets created by other persons.

When we create secrets in UI, we receive this friendly message, unfortunately it is a lie because its not how system behaves, and takes you by surprise.

"Setup key created successfully!
This key will not be shown again, so be sure to copy it and store in a secure location."

And we also get these keys in browser while using admin console, we can see them raw in Networking tab DevTools

To Reproduce

Steps to reproduce the behavior:
0. Self-hosted Instance

  1. Create service user
  2. Assign User role to newly created user
  3. Create an API token
  4. curl -X GET https://netbird.example.com/api/setup-keys
    -H 'Accept: application/json'
    -H 'Authorization: Token '
  5. Can use fetched setup key

Expected behavior
Remove key field from response

Are you using NetBird Cloud?

no

NetBird version

netbird version

0.28.7

NetBird status -dA output:

Do you face any (non-mobile) client issues?

Screenshots

Additional context

Originally created by @alexcupertme on GitHub (Sep 11, 2024). **Describe the problem** Service user with role User can view all setup keys via API. This is a huge **critical** problem, because it is a secret, which should be provisioned to the app using it **once**, and should be shown once we created it, not every time and EVEN WORSE - NOT all secrets created by other persons. When we create secrets in UI, we receive this friendly message, unfortunately it is a lie because its not how system behaves, and takes you by surprise. "Setup key created successfully! This key will not be shown again, so be sure to copy it and store in a secure location." And we also get these keys in browser while using admin console, we can see them raw in Networking tab DevTools **To Reproduce** Steps to reproduce the behavior: 0. Self-hosted Instance 1. Create service user 2. Assign User role to newly created user 3. Create an API token 4. curl -X GET https://netbird.example.com/api/setup-keys \ -H 'Accept: application/json' \ -H 'Authorization: Token <token>' 5. Can use fetched setup key **Expected behavior** Remove key field from response **Are you using NetBird Cloud?** no **NetBird version** `netbird version` 0.28.7 **NetBird status -dA output:** - **Do you face any (non-mobile) client issues?** - **Screenshots** - **Additional context** -
saavagebueno added the waiting-feedbacktriage-needed labels 2025-11-20 05:26:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1231