Headline
CVE-2023-43652: Non-MFA account takeover via using only SSH public key to login
JumpServer is an open source bastion host. As an unauthenticated user, it is possible to authenticate to the core API with a username and an SSH public key without needing a password or the corresponding SSH private key. An SSH public key should be considered public knowledge and should not used as an authentication secret alone. JumpServer provides an API for the KoKo component to validate user private key logins. This API does not verify the source of requests and will generate a personal authentication token. Given that public keys can be easily leaked, an attacker can exploit the leaked public key and username to authenticate, subsequently gaining access to the current user’s information and authorized actions. This issue has been addressed in versions 2.28.20 and 3.7.1. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Package
pip jumpserver (pip)
Affected versions
v2.0.0-v2.28.19,v3.0.0-v3.7.0
Patched versions
v2.28.20,v3.7.1
Impact
An attacker can exploit the leaked public key and username to authenticate, subsequently gaining access to the current user’s information and authorized actions.
Details
JumpServer provides an API for the KoKo component to validate user private key logins. This API does not verify the source of requests and will generate a personal authentication token. Given that public keys can be easily leaked, an attacker can exploit the leaked public key and username to authenticate, subsequently gaining access to the current user’s information and authorized actions.
Reproduction steps
Create a test instance of JumpServer and login as the admin user.
Add an SSH public key on the /ui/#/profile/setting?activeTab=SSHUpdate
page, e.g. one from the example GitHub link above.Logout.
Generate an API token with the request:
curl http://localhost/api/v1/authentication/tokens/ -H “Content-Type: application/json” -d ‘{"username": "admin", "public_key": "SSH_PUBLIC_KEY"}’
Patches
Safe versions:
- v2.28.20
- v3.7.1
Workarounds
It is recommended to upgrade the safe versions.
After the upgrade, token could not be create by public key
References
Thanks for Oskar Zeino-Mahmalat of Sonar found and report this vulnerability