Back to skill

Security audit

htaccess Generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent local .htaccess generator, but users should treat its inputs and output file path carefully because it performs little validation.

Install only if you are comfortable reviewing generated Apache configuration. Use trusted, simple values for domains, origins, IPs, paths, and rewrite expressions; avoid feeding user-controlled text into this tool; and be careful with --output because it may overwrite the named file.

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/htaccess_gen.py:51
Finding

Apache Configuration Injection Through Unsanitized CLI Arguments

Content
View full analysis
") parts.append(f' Header set Access-Control-Allow-Origin "{origin}"') ``` ```python # Hotlink protection if args.hotlink_protection: domain = args.domain or "example.com" parts.append(section("Hotlink Protection")) parts.append("RewriteEngine On") parts.append("RewriteCond %{HTTP_REFERER} !^$") parts.append(f"RewriteCond %{{HTTP_REFERER}} !^https?://(www\\.)?{domain.replace('.', '\\.')} [NC]") parts.append("RewriteRule \\.(jpg|jpeg|png|gif|webp|svg)$ - [F,NC]") ``` ```python # IP blocking if args.block_ip: parts.append(section("IP Blocking")) parts.append("") parts.append(" Require all granted") for ip in args.block_ip: parts.append(f" Require not ip {ip}") parts.append("") ``` ```python # Directory index if args.index: parts.append(section("Directory Index")) parts.append(f"DirectoryIndex {args.index}") ``` ```python def redirect(args): code = args.type or 301 parts = [] parts.append("RewriteEngine On") parts.append(f"RewriteRule ^{args.from_path.lstrip('/')}$ {args.to} [L,R={code}]") print("\n".join(parts)) ``` ```python def rewrite(args): parts = [] parts.append("RewriteEngine On") if args.condition: for cond in args.condition: parts.append(f"RewriteCond {cond}") flags = args.flags or "[L,QSA]" parts.append(f"RewriteRule {args.pattern} {args.target} {flags}") ...[truncated 3267 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/htaccess_gen.py:18
Finding

Host Header Injection in Canonical Redirect Rules

Content
View full analysis
Remediation
View remediation
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 (2)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises or implies a file-writing capability via the documented --output <file> behavior, but it does not declare any tool scope such as permissions or allowed-tools. This creates a capability-transparency gap: an agent may write attacker-influenced content to arbitrary files without explicit permission boundaries, increasing the risk of unsafe file modification or overwrite in downstream automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script writes generated content directly to the user-specified output path with write_text() and only reports success afterward. While the CLI argument names the output path, there is no confirmation prompt or cautionary message that this action will modify or replace an existing file.

Content

No source excerpt is available for this finding.