VYPR
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.

PackageAffected versionsPatched versions
cai-frameworkPyPI
<= 0.5.9

Affected products

1

Patches

1
09ccb6e0bacc

Merge commit from fork

https://github.com/aliasrobotics/caiEdoardo OttavianelliDec 9, 2025via ghsa
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

News mentions

0

No linked articles in our index yet.