Back to skill

Security audit

Standards Compliance Checker

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward construction standards compliance checker with disclosed file-based input/output and no evidence of hidden or destructive behavior.

Before installing, confirm you are comfortable granting filesystem access for project data files and exports. Avoid accepting arbitrary custom validation rules from untrusted users unless you add pattern length limits, schema checks, and regex execution safeguards.

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

Warning
Location
SKILL.md:175
Finding

Unrestricted Custom Regular Expressions May Cause Denial of Service

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:175 and SKILL.md:236-241
Vulnerability Type: Regular Expression Denial of Service (ReDoS)
Risk Level: Medium

Vulnerable Code

python
# Pattern check
if 'pattern' in rule:
    if not re.match(rule['pattern'], str(value)):
        return ComplianceIssue(
            rule_id=rule['id'],
            rule_name=rule['name'],
            severity="error",
            message=f"Field '{field}' does not match required format",
            field=field,
            value=value
        )
python
def add_custom_rule(self, standard: Standard, rule: Dict):
    """Add custom compliance rule."""

    if standard not in self.rules:
        self.rules[standard] = []
    self.rules[standard].append(rule)

Technical Analysis

The add_custom_rule method accepts an unrestricted rule dictionary and stores it without schema validation, pattern validation, or length limits. If the rule contains a pattern property, _check_rule passes that pattern directly to Python's backtracking regular-expression engine through re.match.

Certain patterns, such as nested or ambiguous quantifiers, can exhibit catastrophic backtracking when evaluated against specially constructed long input. Neither the pattern execution nor the surrounding compliance check applies a timeout or computational complexity limit.

Exploitation requires an attacker or untrusted caller to be able to add a custom rule and subsequently cause validation of a crafted field value. The built-in patterns alone were not established as exploitable by this audit.

Attack Path

  1. An attacker supplies a custom rule containing a pathological expression, such as a nested-quantifier pattern.
  2. The application passes that rule to add_custom_rule, which stores it without validation.
  3. The attacker submits a long field value designed to force extensive regex backtracking.
  4. `c ...[truncated 629 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not accept arbitrary regular expressions from untrusted users. Prefer predefined validation operators or an allowlist of reviewed patterns.
  • Define and enforce a strict schema for custom rules, including permitted keys, expected types, and maximum pattern and input lengths.
  • Reject patterns containing dangerous constructs such as nested quantifiers, ambiguous alternations, or excessive repetition. Pattern inspection should be treated as defense in depth rather than a complete solution.
  • Use a regular-expression engine with guaranteed linear-time behavior where available.
  • If Python's re engine must be used, perform untrusted matching in an isolated worker process with a strict execution timeout and resource limits so the worker can be terminated safely.
  • Limit the maximum size of values passed to regex validation.
  • Restrict access to add_custom_rule to trusted administrators or trusted application code.
  • Add tests using known catastrophic-backtracking patterns and adversarially long input to verify that validation remains bounded.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.