Back to skill

Security audit

Sovereign code-review-helper

Security checks for vulnerabilities and agentic risk

Overview

The skill fits a code-review purpose, but its packaged script appears unreliable for the security protections it advertises, especially as a CI gate.

Review carefully before installing or using this as a security gate. It does not show evidence of exfiltration or hidden persistence, but its advertised security checks and CI-blocking behavior are not trustworthy as packaged. Avoid relying on it to approve merges, and be careful with --output-file paths because existing files may be overwritten.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/review.sh:359
Finding
Security findings are discarded because pipeline loops execute in subshells<![CDATA[ ## Vulnerability Details **File Location**: `scripts/review.sh`, lines 359–403 **Vulnerability Type**: Security scanner fail-open behavior caused by lost subshell state **Risk Level**: High ### Vulnerable Code ```bash # SEC-001: Hardcoded secrets while IFS= read -r file; do if grep -nEi '(api[_-]?key|secret|password|token|credential)\s*[=:]\s*["\x27][^"\x27]{8,}' "$file" 2>/dev/null | head -5 | while IFS=: read -r line_num content; do add_issue "critical" "security" "SEC-001" "Possible hardcoded secret detected" "$file" "$line_num" done; then true; fi done <<< "$CHANGED_FILES" # SEC-002: SQL injection patterns if [[ "$HAS_PYTHON" == "true" ]] || [[ "$HAS_JS" == "true" ]]; then while IFS= read -r file; do if grep -nE '(execute|query)\s*\(\s*["\x27].*(%s|\$\{|" *\+)' "$file" 2>/dev/null | head -5 | while IFS=: read -r line_num content; do add_issue "critical" "security" "SEC-002" "Possible SQL injection via string interpolation" "$file" "$line_num" done; then true; fi done <<< "$CHANGED_FILES" fi # SEC-003: eval/exec usage while IFS= read -r file; do if grep -nE '\b(eval|exec)\s*\(' "$file" 2>/dev/null | head -5 | while IFS=: read -r line_num content; do add_issue "warning" "security" "SEC-003" "Use of eval/exec detected" "$file" "$line_num" done; then true; fi done <<< "$CHANGED_FILES" # SEC-004: HTTP URLs (should be HTTPS) while IFS= read -r file; do if grep -nE 'http://[^l][^o][^c]' "$file" 2>/dev/null | grep -v 'localhost\|127\.0\.0\.1\|0\.0\.0\.0' | head -5 | while IFS=: read -r line_num content; do add_issue "warning" "security" "SEC-004" "HTTP URL detected (should use HTTPS)" "$file" "$line_num" done; then true; fi done <<< "$CHANGED_FILES" # SEC-005: Disabled TLS verification while IFS= read -r file; do if grep -nEi '(verify\s*=\s*False|NODE_TLS_REJECT_UNAUTHORIZED.*0|InsecureSkipVerify.*true)' "$file" 2>/dev/null | head -5 | while IFS=: read -r line_num ...[truncated 3488 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Replace every pipeline-fed state-mutating loop with process substitution so that the `while` loop executes in the current shell: ```bash while IFS=: read -r line_num content; do add_issue "critical" "security" "SEC-001" \ "Possible hardcoded secret detected" "$file" "$line_num" done < <( grep -nEi \ '(api[_-]?key|secret|password|token|credential)\s*[=:]\s*["\x27][^"\x27]{8,}' \ "$file" 2>/dev/null | head -5 ) ``` Apply the same structure to SEC-002 through SEC-006 and to any other check that modifies arrays or counters from a pipeline-fed loop. Additional hardening should include: 1. Add automated tests containing one positive fixture for every security check. 2. Assert that each fixture appears in Markdown, JSON, and text output. 3. Assert that every critical fixture causes exit status 1. 4. Add a negative fixture for each check to detect false positives. 5. Run the test suite under the minimum documented Bash version and current supported versions. 6. Avoid relying solely on `shopt -s lastpipe`, because its behavior depends on shell mode and environment; process substitution is explicit and more portable within the declared Bash requirement. 7. Add a CI regression test that fails if a detected issue does not increment the corresponding parent-shell counter. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Session Persistence

Medium
Category
Rogue Agent
Content
1. Copy the skill to your OpenClaw skills directory:

```bash
mkdir -p ~/.openclaw/skills/
cp -r code-review-helper/ ~/.openclaw/skills/
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger phrases are generic terms like 'code review', 'review code', and 'security check', which are likely to match many ordinary user requests outside the narrow intent of this specific skill. That can cause unintended invocation of the skill in contexts where it was not explicitly requested, increasing the chance of prompt hijacking, workflow interference, or unexpected execution of the referenced shell entrypoint.

Missing User Warnings

Low
Confidence
94% confidence
Finding
This markdown file advertises the `--output-file <path>` option and later shows examples writing to `review.json`, `review-results.json`, and `review-comment.md`, but it does not include any warning that the operation writes to disk and may overwrite an existing file. For markdown files, omissions around behaviors that can affect user data or system state should be disclosed.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The script writes generated template content directly to a user-specified path via redirection, which can overwrite existing files. Although the option description says it will write to a file, there is no confirmation prompt or explicit warning at the write site before the operation occurs.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The script writes the generated report directly to the path supplied by --output-file, which may overwrite an existing file. There is no confirmation prompt or explicit overwrite warning immediately before this file write operation.

Static analysis

No suspicious patterns detected.