Back to skill

Security audit

Security Audit Enhanced

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent security-audit tool, but its permission-fixing utility can change files outside the requested target through symlinks and its reports can embed unescaped input.

Review before installing or running remediation. Use the audit in read-only/report mode first, avoid running check_permissions.py --fix on directories that may contain untrusted symlinks, and treat generated HTML reports from untrusted JSON as unsafe until escaping is fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/check_permissions.py:18
Finding

Symlink Traversal Allows Permission Changes Outside the Requested Audit Root

Content
View full analysis
List[Tuple[Path, int, int, str]]: """Check permissions and return list of issues.""" issues = [] if not path.exists(): return issues if path.is_dir(): current = get_permissions(path) if current > expected_dir: issues.append((path, current, expected_dir, "directory")) # Recursively check contents for item in path.iterdir(): issues.extend(check_permissions(item, expected_dir, expected_file)) else: current = get_permissions(path) if current > expected_file: issues.append((path, current, expected_file, "file")) return issues def fix_permissions(path: Path, expected_dir: int = 0o700, expected_file: int = 0o600) -> int: """Fix permissions for a path. Returns count of fixed items.""" issues = check_permissions(path, expected_dir, expected_file) fixed = 0 for item_path, current, expected, item_type in issues: try: os.chmod(item_path, expected) print(f"✓ Fixed {item_type}: {item_path} ({oct(current)} → {oct(expected)})") fixed += 1 except PermissionError as e: print(f"✗ Failed to fix {item_path}: {e}") return fixed ``` ### Technical Analysis The recursive permission checker does not reject symbolic links or enforce that resolved paths remain under the user-supplied audit root. `Path.is_dir()`, `Path.stat()`, directory traversal, and `os.chmod()` normally follow symbolic links. Consequently, a symbolic link placed inside the selected directory can redirect the audit to a file or directory outside that tree. If `--fix` is ena ...[truncated 1650 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit.py:209
Finding

Unix Permission Validation Uses Incorrect Numeric Comparisons

Content
View full analysis
0o600: self._add_finding( domain, "critical", f"Config file has overly permissive permissions: {perms}", f"Run: chmod 600 {self.config_path}", {"file": str(self.config_path), "permissions": perms} ) passed = False # Check credentials directory for cred_path in CREDENTIALS_PATHS: if cred_path.exists(): perms = self._get_file_permissions(cred_path) if perms and int(perms, 8) > 0o700: self._add_finding( domain, "high", f"Credentials directory has loose permissions: {perms}", f"Run: chmod 700 {cred_path}", {"path": str(cred_path), "permissions": perms} ) passed = False # Check JSON files in credentials for json_file in cred_path.rglob("*.json"): perms = self._get_file_permissions(json_file) if perms and int(perms, 8) > 0o600: self._add_finding( domain, "high", f"Credential file has loose permissions: {perms}", f"Run: chmod 600 {json_file}", {"file": str(json_file), "permissions": perms} ) passed = False ``` ```python clawdbot_dir = Path.home() / ".clawdbot" if clawdbot_dir.exists(): perms = self._get_file_permissions(clawdbot_dir) if perms and int(perms, 8) > 0o700: sel ...[truncated 3098 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_report.py:185
Finding

Unescaped Audit Data Allows Script Injection into Generated HTML Reports

Content
View full analysis
str: """Generate HTML for a single finding.""" severity = finding.get("severity", "low") return f'''
{severity} {finding.get("domain", "unknown")}

{finding.get("finding", "")}

Fix: {finding.get("recommendation", "")}
''' def generate_html_report(report: Dict[str, Any]) -> str: """Generate HTML report from audit results.""" findings_html = "" for finding in report.get("findings", []): findings_html += generate_finding_html(finding) return HTML_TEMPLATE.format( score=report.get("score", 0), rating=report.get("rating", "Unknown"), score_color=get_score_color(report.get("score", 0)), critical=report.get("summary", {}).get("critical", 0), high=report.get("summary", {}).get("high", 0), medium=report.get("summary", {}).get("medium", 0), low=report.get("summary", {}).get("low", 0), passed=report.get("summary", {}).get("passed", 0), timestamp=report.get("timestamp", ""), platform=report.get("platform", ""), findings_html=findings_html, ) ``` ### Technical Analysis The report generator loads values from an input JSON file and interpolates them directly into HTML. It does not perform context-appropriate HTML escaping. The following fields can contain attacker-controlled markup: - `severity` - `domain` - `finding` - `r ...[truncated 1744 chars]
Remediation
View remediation
``` 6. Add regression tests using payloads in every interpolated field, including: ```html "> ``` 7. Treat externally supplied JSON reports as untrusted data and document that generated reports should not be opened until validation succeeds. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description claims a broad automated audit framework with scoring, baseline comparison, and cross-platform scanning, yet the content mainly provides manual shell snippets and also includes configuration-modifying chmod/jq examples. This mismatch can mislead users and orchestrators about what the skill actually does, especially that it may alter files rather than only inspect them.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 269)May include surrounding context.

md
{
  "blocked_commands": [
    "rm -rf",
    "rm -rf /",
    "dd if=",
    "mkfs",
    ":(){ :|:& };:",

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 269)May include surrounding context.

md
{
  "blocked_commands": [
    "rm -rf",
    "rm -rf /",
    "dd if=",
    "mkfs",
    ":(){ :|:& };:",

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 273)May include surrounding context.

md
"dd if=",
    "mkfs",
    ":(){ :|:& };:",
    "curl | bash",
    "wget | bash",
    "git push --force",
    "chmod 777",

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 274)May include surrounding context.

md
"mkfs",
    ":(){ :|:& };:",
    "curl | bash",
    "wget | bash",
    "git push --force",
    "chmod 777",
    "> /dev/sda"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 275)May include surrounding context.

md
":(){ :|:& };:",
    "curl | bash",
    "wget | bash",
    "git push --force",
    "chmod 777",
    "> /dev/sda"
  ]

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 276)May include surrounding context.

md
"curl | bash",
    "wget | bash",
    "git push --force",
    "chmod 777",
    "> /dev/sda"
  ]
}

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 450)May include surrounding context.

md
2. Add domain to checklist in `SKILL.md`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises operational commands and auto-fix behavior but does not declare any explicit tool scope or allowed-tools restrictions. In an agent environment, this can cause the skill to run with broader shell, environment, and file-write capabilities than a user would reasonably expect, increasing the chance of unintended filesystem or configuration changes.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · SKILL.md (reported line 128)May include surrounding context.

Check:

bash
# Check credential files exist and permissions
ls -la ~/.clawdbot/credentials/ 2>/dev/null
# Check config permissions
stat -f "%Lp" ~/.clawdbot/clawdbot.json 2>/dev/null || stat -c "%a" ~/.clawdbot/clawdbot.json 2>/dev/null

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 139)May include surrounding context.

Fix:

bash
chmod 700 ~/.clawdbot
chmod 600 ~/.clawdbot/clawdbot.json
chmod 600 ~/.clawdbot/credentials/*.json 2>/dev/null

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 140)May include surrounding context.

Fix:

bash
chmod 700 ~/.clawdbot
chmod 600 ~/.clawdbot/clawdbot.json
chmod 600 ~/.clawdbot/credentials/*.json 2>/dev/null

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 141)May include surrounding context.

Fix:

bash
chmod 700 ~/.clawdbot
chmod 600 ~/.clawdbot/clawdbot.json
chmod 600 ~/.clawdbot/credentials/*.json 2>/dev/null

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · SKILL.md (reported line 213)May include surrounding context.

9. Plugin Trust 🟡 Medium

Risk: Untrusted plugins can execute arbitrary code.

Check:

bash

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 276)May include surrounding context.

md
"curl | bash",
    "wget | bash",
    "git push --force",
    "chmod 777",
    "> /dev/sda"
  ]
}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown promotes an auto-fix mode without an explicit warning that it can modify local configuration or permissions. In agent-driven use, a user may interpret this as a safe diagnostic action and unintentionally permit state-changing operations on sensitive files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The standalone permission-fixing example directly encourages altering filesystem permissions without clearly warning about side effects or rollback considerations. On sensitive paths, incorrect execution could break application behavior or obscure auditability of who changed security settings.

Content

No source excerpt is available for this finding.

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/audit.py (reported line 64)May include surrounding context.

python
def _run_command(self, cmd: List[str]) -> Tuple[str, int]:
        """Run a shell command and return output + return code."""
        try:
            result = subprocess.run(
                cmd, capture_output=True, text=True, timeout=30
            )
            return result.stdout.strip(), result.returncode

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/audit.py (reported line 216)May include surrounding context.

python
domain,
                    "critical",
                    f"Config file has overly permissive permissions: {perms}",
                    f"Run: chmod 600 {self.config_path}",
                    {"file": str(self.config_path), "permissions": perms}
                )
                passed = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/audit.py (reported line 243)May include surrounding context.

python
domain,
                    "critical",
                    f"Config file has overly permissive permissions: {perms}",
                    f"Run: chmod 600 {self.config_path}",
                    {"file": str(self.config_path), "permissions": perms}
                )
                passed = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/audit.py (reported line 230)May include surrounding context.

python
domain,
                        "high",
                        f"Credentials directory has loose permissions: {perms}",
                        f"Run: chmod 700 {cred_path}",
                        {"path": str(cred_path), "permissions": perms}
                    )
                    passed = False

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/audit.py (reported line 361)May include surrounding context.

python
domain,
                        "high",
                        f"Credentials directory has loose permissions: {perms}",
                        f"Run: chmod 700 {cred_path}",
                        {"path": str(cred_path), "permissions": perms}
                    )
                    passed = False

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The HTML report footer states 'No changes were made to your configuration,' but this script does perform a filesystem side effect by writing the generated report to the path provided with --output. While it does not modify the audited configuration itself, the broad wording in the generated documentation can mislead users into thinking the tool makes no writes at all.

Content

No source excerpt is available for this finding.