VM Snapshot VNC Password Loss Variant leading to Unauthenticated Console Access
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- infrastructure, security
Direzione di ricerca
Iniziate da plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreVMSnapshotCommandWrapper.java, alla chiamata getXMLDesc(0) segnalata, quindi confrontate l’utilizzo sicuro di getXMLDesc(1) in LibvirtGetRemoteVmsCommandWrapper.java. Tracciate il percorso dell’XML fino a generateVMSnapshotXML e snapshotCreateXML. Il lavoro è completato quando il percorso degli snapshot non rimuove più la password VNC e il pattern di audit segnalato non è presente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Advisory Details
Title: VM Snapshot VNC Password Loss Variant leading to Unauthenticated Console Access
Description:
An incomplete security audit fix in Apache CloudStack's KVM hypervisor agent causes VM graphics/VNC console passwords to be permanently stripped when VM snapshots are created or redefined. Reverting a VM to these snapshots restores the VM using the password-less XML configuration, allowing unauthorized network-adjacent attackers to connect to the VM's guest OS console without VNC authentication.
Summary
An incomplete fix for CVE-2015-3252 (specifically, missing the VM snapshot definition/restoration path) allows attackers to bypass VNC authentication controls on KVM-managed guest virtual machines. When a KVM hypervisor agent restores VM snapshot metadata, it calls dm.getXMLDesc(0), which strips the graphics tag's password property (passwd='...'). Subsequent reversion to this snapshot re-registers the VM with libvirt without a VNC password, leaving the virtual machine console wide open to unauthenticated users.
Details
During patch completeness audits of Apache CloudStack, we analyzed the patch commit 5d29b63cfa98a15d7734798c5b29a43658d7f112 for CVE-2015-3252. The original issue stripped VNC passwords because the domain XML was retrieved using dm.getXMLDesc(0) (the default flag 0 explicitly removes all security-sensitive credentials).
While the developers successfully fixed the VM reboot and VM migration paths by using dm.getXMLDesc(1) and dm.getXMLDesc(8) respectively, they missed the snapshot definition and restoration path in LibvirtRestoreVMSnapshotCommandWrapper.java.
Inside LibvirtRestoreVMSnapshotCommandWrapper.java:
Domain dm = null;
try {
final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
Connect conn = libvirtUtilitiesHelper.getConnection();
dm = libvirtComputingResource.getDomain(conn, vmName);
if (dm == null) {
return new RestoreVMSnapshotAnswer(cmd, false,
"Restore Instance Snapshot Failed due to can not find Instance: " + vmName);
}
String xmlDesc = dm.getXMLDesc(0); // <--- 💥 Insecure Flag 0 strips VNC passwd!
This insecure XML description is then used to generate the snapshot metadata via libvirtUtilitiesHelper.generateVMSnapshotXML(...) and persisted on the host with dm.snapshotCreateXML(vmSnapshotXML, flags).
Because getXMLDesc(0) was called, the <graphics type='vnc' ...> tag has no passwd attribute inside the stored snapshot. When a tenant user later reverts the VM to this snapshot, libvirt restores the graphics configuration from this stripped definition, permanently erasing VNC password protection and exposing the VNC port (ports 5900+) to unauthenticated console connections.
PoC
Prerequisites
- Apache CloudStack KVM Agent installed on a KVM hypervisor.
- A virtual machine configured with VNC password protection.
- Docker & Python 3 installed locally.
Reproduction Steps
-
Set up the local test simulation by downloading the Docker Compose file: docker-compose.yml
-
Start the simulation environment:
docker compose up -d -
Download the automated static codebase audit script: verification_test.py
-
Execute the verification script:
python3 verification_test.py -
Download the control group verification script: control-secure_xml_flag.py
-
Execute the control group script:
python3 control-secure_xml_flag.py
Log of Evidence
==========================================================================
CVE-2015-3252 VM Snapshot VNC Password Loss Variant Verification Test
==========================================================================
[*] Vulnerable Source File Path: /root/distributed-project/cloudstack/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreVMSnapshotCommandWrapper.java
[*] CloudStack Management Server API URL: http://localhost:8080/client/api
[*] Attempting to connect to live CloudStack Management Server...
[-] Live CloudStack Management Server is not reachable at localhost:8080.
[*] Falling back to static/bytecode audit verification on the compiled/source environment...
--- Static Source Audit Flow ---
[*] Analyzing source code file for unpatched CVE-2015-3252 variant pattern...
[+] Match found! Found vulnerable pattern 'dm.getXMLDesc(0)' in source file.
Line 59: String xmlDesc = dm.getXMLDesc(0);
==========================================================================
[DEFECT CONFIRMED] - The VNC password loss variant in LibvirtRestoreVMSnapshotCommandWrapper is present!
Explanation: The Domain XML is fetched using dm.getXMLDesc(0) which strips the sensitive VNC password.
Redefining the snapshot with this XML will cause permanent loss of the password upon snapshot revert.
==========================================================================
==========================================================================
CVE-2015-3252 VM Snapshot VNC Password Loss Variant - Control Group Test
==========================================================================
[*] Control Source File Path: /root/distributed-project/cloudstack/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetRemoteVmsCommandWrapper.java
--- Control Group Static Source Audit Flow ---
[*] Analyzing control source code file for correct security mechanism usage (flag 1)...
[+] Match found! Found secure pattern 'getXMLDesc(1)' in control source file.
Line 89: parser.parseDomainXML(domain.getXMLDesc(1));
==========================================================================
[CONTROL SUCCESSFUL] - The security mechanism (VIR_DOMAIN_XML_SECURE flag 1)
is correctly functioning and implemented in standard control components.
This confirms that the secure behavior is fully supported and expected by design,
making the 'getXMLDesc(0)' pattern in the snapshot flow a genuine security defect.
==========================================================================
Impact
- Vulnerability Category: Cryptographic credential loss / Unauthenticated Access / Information Disclosure (CWE-200 / CWE-250)
- Compromised Assets: Entire Guest Virtual Machine OS.
- Security Impact: High. Any network-adjacent attacker or unauthorized console proxy user can fully hijack the guest OS console via the hypervisor's unprotected VNC port (usually
5900+) without needing credentials, bypassing all VM-level console authentication mechanisms.
Affected products
- Ecosystem: maven
- Package name: org.apache.cloudstack:cloudstack-plugins-hypervisor-kvm
- Affected versions: <= 4.22.1.0
- Patched versions:
Severity
- Severity: High
- Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses
- CWE: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Occurrences
| Permalink | Description |
|---|---|
| https://github.com/apache/cloudstack/blob/348ce953a99246a756b527994f7745a7be038234/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreVMSnapshotCommandWrapper.java#L59 | The vulnerable execute method retrieves domain XML with a flag value of 0 in LibvirtRestoreVMSnapshotCommandWrapper.java, stripping the graphics/VNC password. |
- 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 untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
emitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/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