GHSA-m5pq-69xg-vcq3: Medium severity pip/devpi-server vulnerability
Impact
If the replication protocol is enabled by using the primary (or deprecated master) role for a server instance, then the +changelog URL route can be used to read the complete database content including password hashes, and the ids and salts of tokens from devpi-tokens by using a trivially modified GET request.
The leaked hashes use the argon2 algorithm, so they are not immediately at risk by brute-force methods, but dictionary attacks are feasible. If a database leak could have happened, it is advised to change the passwords after a patched version or other mitigation is in place.
When devpi-tokens is in use, the quality of the server secret is important. It might be possible to derive the server secret if actual tokens are public by using similar techniques to finding the password for a hash. If a database leak could have happened and any tokens are public, it is advised to change the server secret.
Besides the information leak this can be used to produce significant CPU, IO and bandwidth usage depending on the database size.
Patches
The logic bug causing this issue is fixed with devpi-server 6.20.2 and devpi-server 7.0.0b3.
Workarounds
When replication isn't used the role can explicitly be set to standalone.
If the server instance is exclusively served through nginx with the devpi-lockdown plugin, the request is redirected to the login form due to missing user information. There is no known exploit in this case.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/devpi-serverto a version that resolves this vulnerability.Fixed in 6.20.2 - Upgrade
Upgrade
devpi-serverto a version that resolves this vulnerability.Fixed in 6.20.2 - Upgrade
Upgrade
devpi-serverto a version that resolves this vulnerability.Fixed in 7.0.0b3 - Configuration
If replication protocol is not used, set the server instance role explicitly to "standalone" instead of using the "primary" (deprecated "master") role.
devpi-server replication configuration server instance role = standalone - Operational
If a database leak could have happened and any tokens are public, change the server secret.
- Operational
If a database leak could have happened, change the passwords after applying a patched version (or another mitigation).
Event History
Frequently Asked Questions
Which devpi-server deployments are exposed?
Server instances configured with the primary role, or the deprecated master role, with the replication protocol enabled are affected. Other deployment roles are not identified as affected in the available information.
What does an attacker need to exploit this issue?
No privileges or user interaction are required. An attacker can use a trivially modified GET request to the +changelog route to retrieve complete database contents, and may also cause substantial CPU, I/O, and bandwidth consumption depending on database size.
Which versions contain the fix?
The issue is fixed in devpi-server 6.20.2 and 7.0.0b3.
What credential rotation is recommended after suspected exposure?
If a database leak may have occurred, change passwords after applying a patch or other mitigation. If devpi-tokens is used and any tokens are public, also change the server secret, since it may be derivable from public tokens.