Critical severityNVD Advisory· Published Dec 10, 2025· Updated Dec 11, 2025
Cybersecurity AI (CAI) vulnerable to Command Injection in run_ssh_command_with_credentials Agent tool
CVE-2025-67511
Description
Cybersecurity AI (CAI) is an open-source framework for building and deploying AI-powered offensive and defensive automation. Versions 0.5.9 and below are vulnerable to Command Injection through the run_ssh_command_with_credentials() function, which is available to AI agents. Only password and command inputs are escaped in run_ssh_command_with_credentials to prevent shell injection; while username, host and port values are injectable. This issue does not have a fix at the time of publication.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
cai-frameworkPyPI | <= 0.5.9 | — |
Affected products
1- Range: <= 0.5.9
Patches
109ccb6e0baccMerge commit from fork
1 file changed · +19 −7
src/cai/tools/command_and_control/sshpass.py+19 −7 modified@@ -15,6 +15,7 @@ from cai.tools.common import run_command # pylint: disable=E0401 # noqa: E501 from cai.sdk.agents import function_tool +import shlex @function_tool def run_ssh_command_with_credentials( @@ -36,14 +37,25 @@ def run_ssh_command_with_credentials( Returns: str: Output from the remote command execution """ - # Escape special characters in password and command to prevent shell injection - escaped_password = password.replace("'", "'\\''") - escaped_command = command.replace("'", "'\\''") - + + try: + port = int(port) + if port <= 0 or port > 65535: + return "port is not a valid integer" + except Exception: + return "port is not a valid integer" + + # Escape special characters to prevent shell injection + quoted_password = shlex.quote(password) + quoted_username = shlex.quote(username) + quoted_host = shlex.quote(host) + quoted_command = shlex.quote(command) + port = str(port) + ssh_command = ( - f"sshpass -p '{escaped_password}' " + f"sshpass -p {quoted_password} " f"ssh -o StrictHostKeyChecking=no " - f"{username}@{host} -p {port} " - f"'{escaped_command}'" + f"{quoted_username}@{quoted_host} -p {port} " + f"{quoted_command}" ) return run_command(ssh_command)
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-4c65-9gqf-4w8hghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-67511ghsaADVISORY
- github.com/aliasrobotics/cai/commit/09ccb6e0baccf56c40e6cb429c698750843a999cghsax_refsource_MISCWEB
- github.com/aliasrobotics/cai/security/advisories/GHSA-4c65-9gqf-4w8hghsax_refsource_CONFIRMWEB
- www.hacktivesecurity.com/blog/2025/12/10/cve-2025-67511-tricking-a-security-ai-agent-into-pwning-itselfghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.