Back to skill

Security audit

Nginx Config Creator

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it can modify and reload live Nginx configuration with unsafe input handling that could overwrite, delete, or inject server configuration.

Review before installing or using on any real server. Only run it in a controlled environment, with trusted arguments, a verified config directory, and backups of existing Nginx configs. Safer behavior would validate service names, domains, and ports; refuse traversal and symlinks; write to a temporary candidate; restore previous files on failure; and avoid shared /tmp paths.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create-and-reload.sh:53
Finding

Unvalidated arguments permit Nginx configuration injection

Content
View full analysis
Remediation
View remediation
&2; exit 1; } ``` 2. Validate the domain as a sequence of valid DNS labels. Reject whitespace, control characters, slashes, braces, semicolons, quotes, and newlines. 3. Require the port to contain only decimal digits and enforce the range `1-65535`: ```bash [[ "$PORT" =~ ^[0-9]+$ ]] && (( PORT >= 1 && PORT <= 65535 )) || { echo "Invalid port" >&2; exit 1; } ``` 4. Reject carriage returns and newline characters explicitly in every value inserted into the configuration. 5. Generate configuration only from validated typed values; do not attempt to make arbitrary input safe through shell quoting because Nginx has its own configuration grammar. 6. Test the generated configuration in an isolated staging context before replacing the active file. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create-and-reload.sh:53
Finding

Service-name path traversal can overwrite or delete files outside the intended configuration directory

Content
View full analysis
"$CONF_FILE_PATH" echo "[OK] Config file written." ``` ```bash else echo "Error: Failed to reload Nginx. Rolling back..." >&2 rm -f "$CONF_FILE_PATH" echo "[ROLLED BACK] Deleted ${CONF_FILE_PATH}" >&2 exit 1 fi ``` ```bash else echo "Error: Nginx configuration test failed. Rolling back..." >&2 cat /tmp/nginx_test_output.log >&2 rm -f "$CONF_FILE_PATH" echo "[ROLLED BACK] Deleted ${CONF_FILE_PATH}" >&2 exit 1 fi ``` ### Technical Analysis `SERVICE_NAME` is used as part of the destination filename without validation. A value containing path separators and `..` components can make `CONF_FILE_PATH` resolve outside `CONFIG_PATH`. Quoting the variable prevents shell word splitting but does not prevent filesystem path traversal. The output redirection also truncates an existing destination before the Nginx test is performed. The rollback logic unconditionally deletes the destination rather than restoring its previous content. Therefore, even without traversal, selecting an existing service name can destroy a valid production configuration if testing or reloading fails. The script also does not reject symbolic-link destinations. If an attacker can create entries inside the configuration directory, a symlink may redirect the write to another file writable by the script's effective user. ### Attack Path 1. The attacker invokes the skill with a crafted service name containing traversal components, such as `../other/location/target`, or targets an existing service configuration. 2. The script conc ...[truncated 1345 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create-and-reload.sh:79
Finding

Predictable shared temporary file permits symlink and concurrency attacks

Content
View full analysis
/tmp/nginx_test_output.log; then ``` ```bash else echo "Error: Nginx configuration test failed. Rolling back..." >&2 cat /tmp/nginx_test_output.log >&2 ``` ```bash rm -f /tmp/nginx_test_output.log ``` ### Technical Analysis The script redirects output to the fixed, globally predictable path `/tmp/nginx_test_output.log`. On common systems, `/tmp` is writable by all local users. Redirection opens the destination before `docker exec` runs and follows symbolic links. A local attacker may pre-create the path as a symbolic link to another file writable by the script's effective user. Opening the path with `>` can then truncate that target and write command output into it. If the script runs with elevated privileges, the filesystem impact may cross the attacker's normal permission boundary. The fixed filename also causes race conditions between concurrent script executions. Separate runs can truncate, read, or delete each other's logs, producing misleading diagnostics and interfering with cleanup. ### Attack Path 1. A local attacker predicts the fixed path `/tmp/nginx_test_output.log`. 2. Before a privileged script execution, the attacker creates that path as a symbolic link to a target file writable by the script. 3. The script executes the redirection and follows the symbolic link. 4. The target is truncated and receives the output of `nginx -t`. 5. Alternatively, concurrent invocations use the same path and overwrite, read, or remove one another's output. ### Impact Assessment The symlink variant can corrupt or truncate files writable by the script's effective user. The exact impact depends on execution privileges and operating-system protections fo ...[truncated 183 chars]
Remediation
View remediation
&1); then ... else printf '%s\n' "$TEST_OUTPUT" >&2 fi ``` 5. Do not reuse a shared filename across independent executions. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% 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 · scripts/create-and-reload.sh (reported line 104)May include surrounding context.

sh
exit 1
fi

rm -f /tmp/nginx_test_output.log

exit 0

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 8)May include surrounding context.

md
## Features

- **Environment Awareness**: Simplifies commands by sourcing configuration from environment variables, falling back to command-line arguments.
- **Safety Fuse Mechanism**: The script performs a configuration test (`nginx -t`) before applying any changes. If the test fails, it automatically deletes the newly created config file (rolls back), ensuring the web server's stability is never compromised.
- **Stateless & Parametric**: Built for automation, receiving all necessary configuration via arguments or environment variables.

## Prerequisites (Recommended)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Features

- **Environment Awareness**: Simplifies commands by sourcing configuration from environment variables, falling back to command-line arguments.
- **Safety Fuse Mechanism**: The script performs a configuration test (`nginx -t`) before applying any changes. If the test fails, it automatically deletes the newly created config file (rolls back), ensuring the web server's stability is never compromised.
- **Stateless & Parametric**: Built for automation, receiving all necessary configuration via arguments or environment variables.

## Prerequisites (Recommended)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents behavior that writes a new Nginx configuration and may automatically delete that file on rollback. Although the behavior is mentioned, it is framed as a feature rather than a clear user warning about modifying server configuration files and performing rollback deletions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest says the skill takes service name, domain, and port as its main arguments, but the code also depends on environment variables for config path and container name. While this supports the claimed 'environment awareness,' reading ambient environment state is an extra capability not clearly justified by the core input contract described in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.