CVE-2026-12530
AWS Bedrock AgentCore SDK command injection via crafted package names.
- CVSS 8.4
- CWE-88
- Input Validation and Sanitization
- Remote
Improper neutralization of argument delimiters in the install_packages() method in AWS Bedrock AgentCore Python SDK versions >= 1.1.3 and < 1.6.1 might allow a remote authenticated user to execute arbitrary commands within the Code Interpreter sandbox via crafted package name arguments. To mitigate this issue, users should upgrade to version 1.6.1.
- CWE
- CWE-88
- CVSS base score
- 8.4
- Published
- 2026-06-17
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- AWS Bedrock
- Fixed by upgrading
- Yes
Solution
Upgrade AWS Bedrock AgentCore Python SDK to version 1.6.1.
Vulnerable code sample
import subprocess
class AgentCore:
def install_packages(self, package_names: list[str]):
# VULNERABLE: The list of package names is joined into a single string
# and executed in a shell. This allows a crafted package name like
# "package; arbitrary_command" to execute arbitrary commands.
command = f"pip install {' '.join(package_names)}"
subprocess.run(command, shell=True)Patched code sample
import subprocess
from typing import List
def install_packages(package_names: List[str]):
"""
This function represents a patched version of the install_packages method,
fixing a command injection vulnerability like the one described in the
hypothetical CVE-2026-12530.
The fix involves passing command arguments as a list, which prevents the
shell from interpreting special characters in the package names.
"""
# The command and its primary argument are defined in a list.
# Using 'python -m pip' is often more robust than just 'pip'.
command = ["python", "-m", "pip", "install"]
# The untrusted package names are appended to the command list.
# Each item is treated as a single, distinct argument. Shell metacharacters
# like ';' or '&&' within a package name are not executed. This is the
# core of the fix that neutralizes the vulnerability.
command.extend(package_names)
# By using subprocess.run with a list of arguments (the default behavior,
# where shell=False), we avoid passing the command through a shell.
# This prevents a crafted package name like "some-package; id" from
# executing the 'id' command. The system will instead safely look for
# a non-existent package named "some-package; id" and fail gracefully.
subprocess.run(command, check=True)Payload
nonexistent-package; id
Cite this entry
@misc{vaitp:cve202612530,
title = {{AWS Bedrock AgentCore SDK command injection via crafted package names.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-12530},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-12530/}}
}
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 ::
