CVE-2026-105812
Improper code generation in Bedrock Agent import lets same‑account users execute arbitrary code.
- CVSS 8.8
- CWE-94
- Input Validation and Sanitization
- Remote
Improper control of code generation in the agent import functionality of Amazon Bedrock AgentCore Starter Toolkit before 0.3.14 might allow an authenticated same-account actor to execute arbitrary code when a user imports and runs or deploys a Bedrock Agent, via crafted configuration values incorporated into generated Python source without safe literal encoding. To remediate this issue, users should upgrade to version 0.3.14. Because this issue persists into generated source, upgrading alone is not sufficient: agents imported with an affected version must be re-imported with version 0.3.14 or later and their local and deployed output artifacts replaced.
- CWE
- CWE-94
- CVSS base score
- 8.8
- Published
- 2026-10-06
- OWASP
- A03 Injection
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Upgrade to Amazon Bedrock AgentCore Starter Toolkit version 0.3.14.
Vulnerable code sample
import json
def import_agent(config_json: str):
# Load user‑provided configuration
config = json.loads(config_json)
# VULNERABLE: executes arbitrary Python from the config
init_code = f"def agent_init():\\n {config['init_body']}"
exec(init_code, globals())
# Return the created function for later use
return globals()['agent_init']Patched code sample
import json
import ast
def import_agent(config_json: str):
# Load user‑provided configuration
config = json.loads(config_json)
# FIX: safely parse the init_body as a literal string without execution
safe_body = ast.literal_eval(repr(config['init_body']))
init_code = f"def agent_init():\\n {safe_body}"
exec(init_code, globals())
# Return the created function for later use
return globals()['agent_init']Cite this entry
@misc{vaitp:cve2026105812,
title = {{Improper code generation in Bedrock Agent import lets same‑account users execute arbitrary code.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-105812},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-105812/}}
}
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 ::
