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

Closed
opened 2025-11-20 05:26:43 -05:00 by saavagebueno · 2 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:43 -05:00
Author
Owner

@nazarewk commented on GitHub (Apr 28, 2025):

Hello @alexcupertme,

We're currently reviewing our open issues and would like to verify if this problem still exists in the latest NetBird version.

Could you please confirm if the issue is still there?

We may close this issue temporarily if we don't hear back from you within 2 weeks, but feel free to reopen it with updated information.

Thanks for your contribution to improving the project!

@nazarewk commented on GitHub (Apr 28, 2025): Hello @alexcupertme, We're currently reviewing our open issues and would like to verify if this problem still exists in the [latest NetBird version](https://github.com/netbirdio/netbird/releases). Could you please confirm if the issue is still there? We may close this issue temporarily if we don't hear back from you within **2 weeks**, but feel free to reopen it with updated information. Thanks for your contribution to improving the project!
Author
Owner

@mlsmaycon commented on GitHub (Jun 1, 2025):

closing issue due to no recent feedback. Feel free to open a new one if the issue persist or reopen if this was a feature request.

@mlsmaycon commented on GitHub (Jun 1, 2025): closing issue due to no recent feedback. Feel free to open a new one if the issue persist or reopen if this was a feature request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1234