Back to skill

Security audit

Nginx

Security checks for vulnerabilities and agentic risk

Overview

This is a purpose-aligned nginx guidance skill with disclosed local preference memory and no evidence of malicious or deceptive behavior.

Install only if you want nginx-focused operational guidance. Expect it to read and update local preference files under ~/Clawic/data/nginx/ and to suggest admin-level nginx commands; review commands before running them, and do not copy the secure_link example without replacing the placeholder secret.

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
security.md:55
Finding
Predictable Hardcoded Secret in Signed URL Configuration Example## Vulnerability Details **File Location**: `security.md:55` **Vulnerability Type**: Hardcoded cryptographic secret in deployable configuration guidance **Risk Level**: Medium **Complete Code Snippet**: ```nginx secure_link $arg_md5,$arg_expires; secure_link_md5 "$secure_link_expires$uri secret"; ``` ### Technical Analysis The `secure_link_md5` directive constructs the value used to validate signed download URLs. The example embeds the literal string `secret` as signing-key material without clearly identifying it as a placeholder that must be replaced. If an operator copies this configuration unchanged, the signing key becomes publicly predictable. Because the protected URI and expiration timestamp are also available to a requester, an attacker can reproduce the expected MD5 input and generate a matching URL signature. The `secure_link` mechanism would then accept attacker-generated links as authentic. This is an insecure example rather than evidence of an exposed production credential, but the surrounding text presents it as configuration that can be used for expiring signed URLs. Its copy-and-deploy nature creates a realistic misconfiguration risk. ### Attack Path 1. An operator copies the documented `secure_link` configuration without replacing `secret`. 2. The resulting Nginx configuration uses a known signing secret in production. 3. An attacker identifies the protected URI and chooses an acceptable future expiration timestamp. 4. The attacker reconstructs the configured signing input from the expiration value, URI, and known literal secret. 5. The attacker computes and encodes the signature in the format expected by Nginx. 6. The attacker submits the forged signature and expiration arguments. 7. Nginx validates the predictable signature and permits access that was intended to require an authorized signed link. ### Impact Assessment Successful exploitation can bypass the signed-link access control for re ...[truncated 355 chars]
Remediation
## Remediation Suggestions - Replace the literal value with an unmistakable placeholder: ```nginx secure_link_md5 "$secure_link_expires$uri <HIGH_ENTROPY_SECRET>"; ``` - Add an explicit warning that the placeholder must never be deployed unchanged. - Generate signing secrets with a cryptographically secure random generator and sufficient entropy. - Store the real secret in a root-controlled configuration file or protected deployment secret mechanism rather than source-controlled public documentation. - Restrict configuration-file permissions to the Nginx service account and authorized administrators. - Use a different secret for each environment and application boundary. - Document a rotation procedure that temporarily accepts old and new signing schemes if uninterrupted link validity is required. - Add deployment validation that rejects known example values such as `secret`, `changeme`, or the documented placeholder. - Avoid logging full signed URLs when query parameters may expose reusable signatures.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Ae1

High
Category
analysis-evasion
Content
reload commands and resolver address; docker/kubernetes routes advice through `containers.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
reload commands and resolver address; docker/kubernetes routes advice through `containers.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
reload commands and resolver address; docker/kubernetes routes advice through `containers.md` |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
app: { condition: service_healthy }
```

- Mount config read-only — a compromised nginx that can rewrite its own config can re-route traffic.
- `depends_on` with a health condition prevents the startup-order 502 (nginx resolves and connects before the app listens); the resolver fix still applies for RESTARTS after startup.
- Pin the image minor version: nginx point releases change directive defaults rarely but visibly (`http2` directive form, `ssl_reject_handshake` availability — version floors are noted where they matter, e.g. `ssl.md`).
Confidence
90% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Exfiltration Commands

High
Category
Prompt Injection
Content
}
```

Named captures beat `fastcgi_split_path_info` because `try_files` resets the split variables — the split-then-try_files combination silently sends an empty SCRIPT_FILENAME.

## Framework Routing
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
| Code | Meaning | First move |
|---|---|---|
| 400 instantly, some clients only | Oversized request headers (big cookies, SSO tokens) | Raise `large_client_header_buffers`; on HTTP/2-heavy traffic see `ssl.md` |
| 403 on files that exist | Worker user can't read the path (check EVERY parent dir has `x`), a `deny` rule, or a directory request with no `index` and `autoindex off` | `sudo -u www-data cat <file>` reproduces the permission case in one command |
| 404 on files that exist | Wrong `root`/`alias` resolution or location mismatch | Re-derive with the matching algorithm (SKILL.md); `root` vs `alias` semantics in `semantics.md` |
| 405 on POST to a static file | The static handler only serves GET/HEAD — common with SPA forms and health checks that POST | Route the path to the backend, or `error_page 405 =200 $uri;` if serving the file is genuinely intended |
| 413 | `client_max_body_size` (default 1m) | Raise it in the exact `server`/`location` that handles uploads |
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill explicitly instructs the agent to read and persist user-specific data in `~/Clawic/data/nginx/` without any requirement to notify the user, request consent, or minimize retention. This creates a privacy and data-governance risk because personal preferences, prior incidents, and environment details may be silently collected, reused, and updated across sessions.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The manifest says the Nginx skill is 'Not for certificate issuance or renewal (ACME, Let's Encrypt) — that is the ssl skill.' However, this file is itself an SSL/TLS-focused document and explicitly directs readers to the ssl skill for issuance/renewal, indicating content from another skill's domain is present here rather than nginx-specific implementation behavior.

Static analysis

No suspicious patterns detected.