IPMI Tool User ID Plaintext Password Exposure in Command Execution
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- java
- Ambito
- infrastructure, security
Direzione di ricerca
Inizia da plugins/outofbandmanagement-drivers/ipmitool/src/main/java/org/apache/cloudstack/outofbandmanagement/driver/ipmitool/IpmitoolOutOfBandManagementDriver.java, concentrandoti su getIpmiUserId e sul relativo percorso di errore da changeOutOfBandManagementPassword. Traccia il modo in cui l'errore del comando raggiunge i log e la risposta della REST API; il lavoro è completo quando la password non è più esposta in nessuna delle due posizioni se la query dell'utente IPMI fallisce.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Advisory Details
Title: IPMI Tool User ID Plaintext Password Exposure in Command Execution
Description:
An information exposure vulnerability exists in Apache CloudStack's Out-of-Band Management (OOBM) IPMI tool driver. When attempting to fetch the numeric IPMI user ID via the private helper method getIpmiUserId, if the underlying ipmitool ... user list command fails (due to incorrect credentials, unreachable BMC hardware, or TLS failures), the driver manually joins the raw command arguments including the plaintext -P <password> option. The resulting unsanitized command string is formatted into a CloudRuntimeException message. This propagates the raw credentials back in the REST API HTTP error response payload and logs them in plaintext to the Management Server system logs, bypassing the general command sanitization patterns implemented in the core execution helpers.
Summary
An information exposure vulnerability in the Out-of-Band Management IPMI driver allows administrative credentials to be leaked in plaintext directly in warning/debug logs and REST API HTTP error responses when an IPMI user query command execution fails. This enables attackers with access to logs or network responses to harvest plaintext IPMI passwords and compromise physical server infrastructure out-of-band.
Details
In IpmitoolOutOfBandManagementDriver.java, when an administrator calls changeOutOfBandManagementPassword to update a host's IPMI management password, the execution path first invokes the private helper method getIpmiUserId() to map the IPMI username to its corresponding numeric user ID:
[REST API client] -> [ChangeOutOfBandManagementPasswordCmd]
-> [OutOfBandManagementServiceImpl.changePassword]
-> [IpmitoolOutOfBandManagementDriver.execute]
-> [getIpmiUserId]
Within getIpmiUserId():
final List<String> ipmiToolCommands = IPMITOOL.getIpmiToolCommandArgs(IpmiToolPath.value(),
IpmiToolInterface.value(),
IpmiToolRetries.value(),
options, "user", "list");
final OutOfBandManagementDriverResponse output = IPMITOOL.executeCommands(ipmiToolCommands, timeOut);
if (!output.isSuccess()) {
String oneLineCommand = StringUtils.join(ipmiToolCommands, " ");
String message = String.format("Failed to find IPMI user [%s] to change password. Command [%s], error [%s].", username, oneLineCommand, output.getError());
logger.debug(message);
throw new CloudRuntimeException(message);
}
If executeCommands() fails, output.isSuccess() returns false. The driver proceeds to construct oneLineCommand by calling StringUtils.join(ipmiToolCommands, " ") on the raw, unsanitized ipmiToolCommands list. This raw list contains the -P argument immediately followed by the plaintext password string. The constructed plaintext string is directly formatted into message, logged to Management Server logs via logger.debug(), and thrown as a CloudRuntimeException. This exception is subsequently caught at the API boundary and returned directly in the REST API HTTP error response payload to the calling client in plaintext.
This custom CLI command joining bypasses standard logging regex patterns introduced in ProcessRunner to sanitize command executions, representing a patch completeness variant of the original Issue-cloudstack-12027 vulnerability.
PoC
Prerequisites
- Administrative credentials to access the CloudStack Management Server REST API (
changeOutOfBandManagementPasswordcommand). - The target physical host's Out-of-Band Management (OOBM) configuration must fail to execute (e.g. incorrect credentials, incorrect target BMC IP, or BMC offline) to trigger the error path.
Reproduction Steps
- Download the automated defect verification script from: verification_test_Issue-cloudstack-12027.py
- Download the scientific control group script from: control-masked_output.py
- Execute the verification script:
python3 verification_test_Issue-cloudstack-12027.py - If the Management Server is online, verify that the returned JSON error payload contains the plaintext password
NewSuperSecretIPMIPassword123!in the command string:"message": "Failed to find IPMI user [...] Command [ipmitool ... -P NewSuperSecretIPMIPassword123! user list], error [...]" - If the server is offline, the script gracefully performs academic validation of the source code files and reports the vulnerability status.
Log of Evidence
===== EXPERIMENT GROUP: VERIFICATION TEST =====
[*] Running Issue-cloudstack-12027 getIpmiUserId Plaintext Password Exposure Integration Test...
[*] Dispatching changeOutOfBandManagementPassword command with sensitive new password: NewSuperSecretIPMIPassword123!
[-] Connection failed: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /client/api?hostid=00000000-0000-0000-0000-000000000000&password=NewSuperSecretIPMIPassword123%21&command=changeOutOfBandManagementPassword&apiKey=ADMIN_API_KEY_PLACEHOLDER&response=json&signature=%2FYD6e0vnVFZ%2FEi0mqWFOalCGWZA%3D (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8080): Failed to establish a new connection: [Errno 111] Connection refused"))
[INCONCLUSIVE] CloudStack Management Server is offline.
[*] Academic verification: getIpmiUserId inside IpmitoolOutOfBandManagementDriver.java is confirmed vulnerable.
[*] Specifically, if the user list command fails, the exception thrown containing the plaintext password option:
'Failed to find IPMI user [username] to change password. Command [ipmitool ... -P <PLAINTEXT_PASSWORD> user list], error [...]'
would be propagated back in the API error response and logged directly to logs in plaintext.
===== CONTROL GROUP: CONTROL TEST =====
[*] Running Issue-cloudstack-12027 getIpmiUserId Control Test...
[*] Dispatching changeOutOfBandManagementPassword command with control condition.
[-] Connection failed: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /client/api?hostid=00000000-0000-0000-0000-000000000000&password=NewSuperSecretIPMIPassword123%21&command=changeOutOfBandManagementPassword&apiKey=ADMIN_API_KEY_PLACEHOLDER&response=json&signature=%2FYD6e0vnVFZ%2FEi0mqWFOalCGWZA%3D (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8080): Failed to establish a new connection: [Errno 111] Connection refused"))
[INCONCLUSIVE] CloudStack Management Server is offline.
[*] Academic verification: Control group baseline check.
[*] Under a secure patch, exception messages and logs must NOT format the password plaintext.
[*] Expected result: The password 'NewSuperSecretIPMIPassword123!' should be masked or omitted.
Impact
This is a high-severity administrative credential exposure vulnerability. Attackers who obtain read access to Management Server log files or can intercept API error payloads can harvest plaintext administrative credentials for physical server BMC hardware (IPMI). Possessing these credentials, an attacker can directly command baseline physical host resources (e.g. issue physical power cycles/power off leading to Denial of Service, configure host boot options to load malicious virtual media, or access the pre-boot BIOS/UEFI shell), entirely bypassing hypervisor and network security zones.
Affected products
- Ecosystem: maven
- Package name: org.apache.cloudstack:cloudstack
- Affected versions: <= 4.22.1.0
- Patched versions:
Severity
- Severity: High
- Vector string: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Weaknesses
- CWE: CWE-532: Insertion of Sensitive Information into Log File
- CWE: CWE-209: Generation of Error Message Containing Sensitive Information
Occurrences
| Permalink | Description |
|---|---|
| https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/plugins/outofbandmanagement-drivers/ipmitool/src/main/java/org/apache/cloudstack/outofbandmanagement/driver/ipmitool/IpmitoolOutOfBandManagementDriver.java#L68-L73 | The vulnerable code section in the getIpmiUserId helper method where the raw, unsanitized commands including plaintext password option are joined upon command execution failure. |
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1.4k
- Merge medio
- 6g 20h
- PR unite (30g)
- 27
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/cloudstack
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Apertabug component:kubernetes
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14070 · 5 commenti ·
-
component:backup
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Apertabug component:ceph
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/cloudstack#13989 · 3 commenti ·
Tutte le issue di apache/cloudstack
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Apertabug frontend maui-pilot
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
objectionary/eo-graphs#74 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100