Back to skill

Security audit

openc3-flow

Security checks for vulnerabilities and agentic risk

Overview

This is a simple Open-C3 flow-listing skill, but it asks for an API key and can expose or execute sensitive configuration if set up insecurely.

Review before installing. Use only a trusted Open-C3 endpoint, configure OPEN_C3_URL with HTTPS, use a least-privileged read-only APP_KEY if possible, keep config.env private with restrictive permissions, and do not use a config.env file supplied by an untrusted party without inspecting it.

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/list-all-flows.sh:10
Finding
Arbitrary Command Execution Through Sourced Configuration File<![CDATA[ ## Vulnerability Details **File Location**: `scripts/list-all-flows.sh:10-15` **Vulnerability Type**: Unsafe shell evaluation of configuration data **Risk Level**: High ### Vulnerable Code ```bash # Load configuration if [ -f "$SKILL_DIR/config.env" ]; then source "$SKILL_DIR/config.env" else echo "Error: config.env not found in $SKILL_DIR" exit 1 fi ``` ### Technical Analysis The script uses Bash `source` to load `config.env`. This does not merely parse environment variable assignments: it executes the entire file as shell code in the current process. Although the file is intended to contain only `OPEN_C3_URL`, `APP_NAME`, and `APP_KEY`, there is no validation that restricts its contents to those assignments. Any command, command substitution, function definition, redirection, or other valid shell construct placed in `config.env` will execute with the privileges of the user invoking the skill. For example, a malicious configuration file could contain: ```bash APP_KEY="$(sensitive_command)" malicious_command ``` This is a local trust-boundary weakness. Exploitation requires an attacker to create or modify the skill's `config.env`, or to influence how that file is provisioned. ### Attack Path 1. An attacker obtains write access to `config.env`, supplies a malicious replacement, or convinces a user to install a crafted configuration file. 2. The attacker inserts arbitrary shell commands alongside apparently valid configuration assignments. 3. The user invokes `scripts/list-all-flows.sh`. 4. Bash executes `source "$SKILL_DIR/config.env"`. 5. The injected commands run before the Open-C3 API request and inherit the invoking user's permissions and environment. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user running the skill. Depending on that user's access, an attacker could: - Read or exfiltrate the Open-C3 application key and other accessible credentials. - Read, ...[truncated 317 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Do not evaluate configuration files as shell programs. 1. Replace `source` with a parser that accepts only an explicit allowlist of keys: - `OPEN_C3_URL` - `APP_NAME` - `APP_KEY` 2. Reject malformed lines, duplicate keys, command substitutions, shell metacharacters, and unexpected variables. 3. Prefer obtaining secrets from a dedicated secret manager or from an already sanitized process environment. 4. Verify that the configuration file is a regular file, is owned by the expected user, and is not writable by group or other users. 5. Recommend restrictive permissions such as `chmod 600 config.env`. 6. Add tests proving that strings such as `$(command)`, backticks, semicolons, and newline-injected commands are treated as data or rejected rather than executed. A safer design is for a non-shell parser to read a strict dotenv format and export only validated values before invoking the script. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/list-all-flows.sh:24
Finding
Open-C3 Credentials Can Be Transmitted Over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/list-all-flows.sh:24-29` **Additional Locations**: `SKILL.md:16`, `README.md:27` **Vulnerability Type**: Plaintext transmission of authentication credentials **Risk Level**: Medium ### Vulnerable Code ```bash # Get all flows and format as table response=$(curl -s -X GET "${OPEN_C3_URL}/api/ci/group/ci/dump" \ -H "appname: ${APP_NAME}" \ -H "appkey: ${APP_KEY}" \ -H "Content-Type: application/json") ``` The documentation explicitly presents plaintext HTTP as a supported configuration: ```bash OPEN_C3_URL="http://your-open-c3-server/" ``` ### Technical Analysis The script accepts `OPEN_C3_URL` without validating its URL scheme and then transmits `APP_NAME` and the sensitive `APP_KEY` in HTTP request headers. Both `README.md` and `SKILL.md` provide `http://` examples, making insecure deployment a documented and foreseeable configuration. When HTTP is used, neither the credentials nor the API response receive transport confidentiality or integrity protection. A network-positioned attacker may inspect the authentication headers or tamper with traffic. The issue is conditional on a user configuring a plaintext HTTP endpoint; HTTPS connections retain normal `curl` certificate verification because the script does not disable it. ### Attack Path 1. A user follows the documented example and configures `OPEN_C3_URL` with an `http://` URL. 2. The user invokes `scripts/list-all-flows.sh`. 3. The script places `APP_NAME` and `APP_KEY` into request headers and sends the request without TLS. 4. An attacker able to observe or manipulate the network path captures the headers or alters the server response. 5. The attacker reuses the captured application credentials against the Open-C3 API, subject to the permissions assigned to those credentials. Potential attackers include users on an untrusted local network, a compromised gateway or proxy, or another actor with access to the traffic path. # ...[truncated 563 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require `OPEN_C3_URL` to use the `https://` scheme and terminate with an error for plaintext `http://` URLs by default. 2. Replace all HTTP examples in `README.md` and `SKILL.md` with HTTPS examples. 3. Preserve `curl` certificate and hostname verification; do not introduce `--insecure` or equivalent options. 4. If a narrowly scoped development exception is necessary, require an explicit opt-in warning and prohibit sending production credentials through it. 5. Use short-lived, least-privileged credentials where supported and rotate any key that may previously have traversed an untrusted plaintext connection. 6. Consider adding `curl --fail-with-body --show-error` and appropriate connection and request timeouts for more reliable error handling, while ensuring responses do not expose credentials in diagnostics. ]]>
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill invokes shell commands via curl/jq but does not declare any tool restrictions such as permissions or allowed-tools. This creates an execution-scope ambiguity where an agent may run shell commands without an explicit least-privilege boundary, increasing the risk of unintended command execution or misuse of stored credentials like APP_KEY. In this case the documented behavior is simple API access, but the lack of declared scope still weakens enforcement and auditability.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The example output is entirely in Chinese, which suggests the skill may present results in a fixed language. The README does not mention any user-selectable language option or justify a Chinese-only locale, which can conflict with language/locale policy expectations.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The script emits all user-facing status and table labels in Chinese, such as '系统共有', '统计信息', and column headers. This imposes a specific language/locale on all users without opt-in or documented justification, which matches the language-policy violation criterion.

Static analysis

No suspicious patterns detected.