Skip to content

Non-MFA account takeover via using only SSH public key to login

Moderate
ibuler published GHSA-fr8h-xh5x-r8g9 Sep 26, 2023

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

Description

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

  1. Create a test instance of JumpServer and login as the admin user.
  2. Add an SSH public key on the /ui/#/profile/setting?activeTab=SSHUpdate
    page, e.g. one from the example GitHub link above.
  3. Logout.
  4. 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

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

CVE ID

CVE-2023-43652

Weaknesses

No CWEs