Back to skill

Security audit

ROS2 Introspection

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a ROS 2 inspection helper, but its safety claims are overstated and it can execute a configured shell setup path unsafely.

Install only if you trust the local ROS environment and the generated config file. Avoid using it where strict read-only behavior or strong sandboxing is required until the setup path is safely quoted or allowlisted and each command's arguments are constrained. Expect it to read live ROS topic and parameter data and to be able to launch rqt_graph.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/safe_ros2_introspection.py:61
Finding

Shell Command Injection Through Unquoted ROS Setup Path

Content
View full analysis
Remediation
View remediation
/setup.bash`. 3. Require the basename to be exactly `setup.bash`. 4. Reject files writable by untrusted users and verify expected ownership. 5. Protect `config/config.json` with restrictive permissions. 6. Avoid PATH-based discovery in security-sensitive deployments; use an administrator-configured allowlist of ROS installations. 7. Add tests using paths containing semicolons, spaces, command substitution, quotes, and newline characters to verify they cannot alter shell parsing. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/safe_ros2_introspection.py:19
Finding

Read-Only Policy Bypass Through Unrestricted ROS Command Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill promises narrowly scoped, read-only ROS graph introspection, but its documented behavior expands beyond that scope by including live stream inspection commands (topic echo, hz, bw), GUI launching (rqt_graph), and environment/setup execution dependencies. This mismatch is dangerous because operators or policy engines may grant trust based on the declared description while the actual behavior invokes broader execution surfaces and potentially discloses sensitive runtime data from the ROS environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module advertises strict safe execution, but it actually evaluates a configuration-derived shell snippet through bash -c after loading JSON from disk. That mismatch is dangerous because users and higher-level agents may trust the wrapper's safety guarantees while it still permits arbitrary code execution if the config or setup path is tampered with.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The implementation's allowed command set exceeds a narrow ROS graph introspection scope despite the manifest claiming strict read-only introspection. Commands like topic echo, topic hz, topic bw, param dump, and the separately allowed rqt_graph can expose message contents, write files, or invoke interactive behavior, creating a trust-boundary mismatch for users relying on the manifest.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The rqt_graph exception bypasses the command-category allowlist and launches a GUI program not described by the skill's stated purpose. In a supposedly safe read-only automation wrapper, this undocumented capability undermines operator expectations and can be abused to trigger unwanted local application execution.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
80% confidence
Finding

Launching rqt_graph is not shell-injection-prone in this form, but it does execute an external GUI application outside the declared 'strictly read-only core introspection' scope. In an agent skill context, permitting GUI launch can cause unexpected side effects, hang automation, or expose a broader local attack surface than a read-only CLI wrapper should.

Content

Scanner excerpt · scripts/safe_ros2_introspection.py (reported line 32)May include surrounding context.

python
# Special case for rqt_graph
    if category == "rqt_graph":
        sys.exit(subprocess.call(["rqt_graph"]))

    if len(sys.argv) < 3:
        # Some commands might just be e.g. "topic list", but if they passed only "topic", it will fail validation below

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code silently executes a shell command based on a dynamically loaded setup path with no disclosure to the caller. In an agent skill advertised as read-only introspection, hidden shell execution materially increases risk because operators may not realize that running the skill also runs arbitrary shell initialization logic from disk.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The wrapper constructs a shell command using a dynamically loaded configuration value and executes it via bash -c. Because ros_setup_path is interpolated directly into source {ros_setup_path} && env without shell escaping, a malicious or compromised config file can inject arbitrary shell commands, leading to code execution under the wrapper's privileges.

Content

Scanner excerpt · scripts/safe_ros2_introspection.py (reported line 75)May include surrounding context.

python
# Build the environment by sourcing the bash file
    env_command = f"source {ros_setup_path} && env"
    try:
        env_proc = subprocess.run(['bash', '-c', env_command], stdout=subprocess.PIPE, text=True, check=True)
        ros_env = {}
        for line in env_proc.stdout.splitlines():
            if '=' in line:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/safe_ros2_introspection.py (reported line 89)May include surrounding context.

python
cmd_array = ["ros2"] + sys.argv[1:]

    # Execute safely without shell=True
    sys.exit(subprocess.call(cmd_array, env=ros_env))

if __name__ == "__main__":
    main()

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description limits the skill to strictly read-only ROS 2 introspection, but this setup script creates a config directory and writes a config.json file. While configuration may support the skill, it is still a state-changing filesystem operation that does not match a strict read-only description.

Content

No source excerpt is available for this finding.