Vulnerability record · CVE-2021-21246 · published 15 January 2021
CVE-2021-21246: OneDev REST user endpoint missing authorization leaks access tokens
Onedev Project · Onedev
OneDev before 4.0.3 fails to enforce an authorization check on the REST /users/{id} endpoint, while the UserResource listing endpoint does check for administrator privileges. An unauthenticated caller can retrieve arbitrary user details, including access tokens, exposing sensitive data.
Description
OneDev is an all-in-one devops platform. In OneDev before version 4.0.3, the REST UserResource endpoint performs a security check to make sure that only administrators can list user details. However for the `/users/{id}` endpoint there are no security checks enforced so it is possible to retrieve arbitrary user details including their Access Tokens! These access tokens can be used to access the API or clone code in the build spec via the HTTP(S) protocol. It has permissions to all projects accessible by the user account. This issue may lead to `Sensitive data leak` and leak the Access Token which can be used to impersonate the administrator or any other users. This issue was addressed in 4.0.3 by removing user info from restful api.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Automated analysis
high priorityUnauthenticated network-reachable token disclosure with a CVSS of 7.5 and very high EPSS percentile, though no confirmed in-the-wild exploitation is documented.
What it is
OneDev before 4.0.3 fails to enforce an authorization check on the REST /users/{id} endpoint, while the UserResource listing endpoint does check for administrator privileges. An unauthenticated caller can retrieve arbitrary user details, including access tokens, exposing sensitive data.
Impact
An attacker obtains user access tokens that grant API access and HTTP(S) code cloning with the permissions of the affected account, including administrator impersonation.
Attack surface
Reachable over the network via the REST API with no authentication and no user interaction, per the CVSS vector AV:N/AC:L/PR:N/UI:N.
Exploitation
Not listed in CISA KEV and no public exploit references are tagged, but EPSS is 0.49051 (98.8th percentile), indicating elevated predicted exploitation activity.
What to do
- Upgrade OneDev to 4.0.3 or later, which removes user info from the REST API.
- If immediate upgrade is not possible, restrict network access to the OneDev REST API to trusted sources.
- Rotate all user access tokens issued before remediation, prioritizing administrator accounts.
- Audit API and repository access logs for unauthorized /users/{id} requests.
Detection
- Monitor HTTP access logs for GET requests to /users/{id} from unauthenticated or unexpected clients.
- Alert on access token usage from new IP addresses or user agents following suspicious /users/{id} requests.
- Review repository clone and API activity for anomalous access patterns tied to exposed tokens.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089 | PatchThird Party Advisory |
| https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gx | Third Party Advisory |
| https://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089 | PatchThird Party Advisory |
| https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gx | Third Party Advisory |
Track CVE-2021-21246 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-21246), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.