Back to skill

Security audit

Code Security Audit

Security checks for vulnerabilities and agentic risk

Overview

This is a genuine security-audit skill, but it needs review because some scan outputs and CI helpers can expose secrets or run mutable third-party tools.

Review before installing or using in CI. Run it only on intended workspaces, avoid verbose secret output, do not publish raw CI grep results, pin third-party audit tool versions, and write reports to a trusted path after checking for symlinks.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/security-audit.sh:248
Finding

Secret Detection Results Can Expose Credentials in Terminal and CI Logs

Content
View full analysis
/dev/null | grep -v "node_modules\|.git\|test\|spec\|example\|placeholder\|your_\|YOUR_\|xxxx\|XXXX" | head -5) if [ -n "$matches" ]; then error "Found potential $name" if [ "$VERBOSE" = true ]; then echo "$matches" | head -3 fi ``` The CI templates similarly invoke `grep` without suppressing matched lines: ```yaml - name: Secret Detection run: | # AWS Access Keys ! grep -rn 'AKIA[0-9A-Z]\{16\}' --include='*.{js,ts,py,env,yml,yaml}' . # OpenAI API Keys ! grep -rn 'sk-[A-Za-z0-9]\{20,\}' --include='*.{js,ts,py,env}' . # GitHub Tokens ! grep -rn 'ghp_[A-Za-z0-9]\{36\}\|github_pat_' --include='*.*' . # Private Keys ! grep -rn 'BEGIN.*PRIVATE KEY' --include='*.*' . continue-on-error: true ``` ### Technical Analysis The scanner stores complete matching source lines in `matches` and prints up to three of those lines when verbose mode is enabled. Because secret assignments commonly place the credential and variable name on the same line, this output can disclose the complete credential. The CI checks also use ordinary recursive `grep`, which prints matching file names, line numbers, and line contents. Negating the exit status with `!` changes only success or failure; it does not suppress output. Consequently, detected secrets may be copied from source files into CI logs. CI logs can have different retention policies and broader access than repositor ...[truncated 1313 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
templates/security-audit.yml:28
Finding

CI Templates Install and Execute Unpinned Third-Party Security Tools

Content
View full analysis
Remediation
View remediation
\ safety== npm install --global audit-ci@ ``` 2. Use Python hash verification with a locked requirements file and `--require-hashes`. 3. Use an npm lockfile or a prebuilt, digest-pinned container image containing the approved scanner versions. 4. Run `npx` with `--no-install` after installing the pinned local package: ```bash npx --no-install audit-ci --moderate ``` 5. Disable or tightly control package lifecycle scripts where compatible with the selected tools. 6. Grant CI jobs only the minimum repository-token permissions, avoid exposing deployment secrets to pull-request jobs, and restrict outbound network access. 7. Use automated dependency-update review so scanner upgrades are explicit repository changes rather than silent runtime resolution. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
templates/security-audit.yml:33
Finding

Security Findings Are Configured as Non-Blocking CI Results

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/security-audit.sh:767
Finding

Predictable Report Output Follows Symbolic Links and Can Overwrite Arbitrary Writable Files

Content
View full analysis
"$output" << EOF ``` ### Technical Analysis The report generator writes to a predictable path in the current working directory by default. Shell output redirection opens the destination with truncation and follows symbolic links. The code does not verify that the destination is a regular file, reject symbolic links, constrain the output to a trusted directory, or create it atomically. The Skill is intended to audit repositories that may contain attacker-controlled content. Such a repository can include `security-audit-report.md` as a symbolic link. When an auditor invokes `--report`, the shell follows the link and replaces the linked target with generated Markdown. Quoting `"$output"` prevents word splitting and wildcard expansion, but it does not protect against symbolic links or pre-existing special files. ### Attack Path 1. An attacker creates and commits a symbolic link named `security-audit-report.md`. 2. The link points to a file writable by the account expected to run the audit. 3. A reviewer checks out the repository with symbolic links preserved. 4. The reviewer runs: ```bash ./scripts/security-audit.sh --report ``` 5. `cat > "$output"` follows the symbolic link and truncates the target. 6. The generated report replaces the target file's previous contents. The same condition can occur with a user-supplied `--output` path if an attacker can create or replace that path before report generation. ### Impact Assessment The overwrite is limited to files writable by the process identity running the scanner. It does not itself bypass operating-system permission checks. Within that boundary, it can: - Destroy or replace user configuration. - Corrupt files in the reposi ...[truncated 283 chars]
Remediation
View remediation
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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
Findings (46)

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
75% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

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

Detection Patterns:

bash
# Find debug mode enabled
grep -rn "DEBUG\s*=\s*true\|debug:\s*true\|NODE_ENV.*development" \
  --include='*.ts' --include='*.js' --include='*.env' --include='*.yaml' --include='*.json' .

Unvalidated Output Injection

High
Category
Output Handling
Confidence
65% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

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

typescript
// ❌ VULNERABLE: Unsanitized HTML
<div dangerouslySetInnerHTML={{ __html: userComment }} />

// ✅ SECURE: Sanitize with DOMPurify
import DOMPurify from 'isomorphic-dompurify'

Unvalidated Output Injection

High
Category
Output Handling
Confidence
65% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

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

typescript
// ❌ VULNERABLE: Unsanitized HTML
<div dangerouslySetInnerHTML={{ __html: userComment }} />

// ✅ SECURE: Sanitize with DOMPurify
import DOMPurify from 'isomorphic-dompurify'

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The file permission audit includes enumerating .env, .pem, .key, and SSH key files and printing metadata with ls -la. In an agent context, even metadata and existence checks around sensitive files can leak operational secrets layout and encourage inspection of credentials outside the intended project scope.

Content

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

fi

Sensitive file permissions

for f in .env .env.* *.pem *.key id_rsa id_ed25519; do [ -f "$f" ] && ls -la "$f" done

text

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · patterns/secrets.json (reported line 131)May include surrounding context.

json
"npm_token": {
      "pattern": "npm_[A-Za-z0-9]{36}",
      "severity": "high",
      "description": "npm Access Token"
    },
    "gitlab_token": {
      "pattern": "glpat-[A-Za-z0-9_-]{20}",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · patterns/secrets.json (reported line 136)May include surrounding context.

json
"npm_token": {
      "pattern": "npm_[A-Za-z0-9]{36}",
      "severity": "high",
      "description": "npm Access Token"
    },
    "gitlab_token": {
      "pattern": "glpat-[A-Za-z0-9_-]{20}",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 162)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 249)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 263)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 574)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 582)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 590)May include surrounding context.

sh
local config_issues=0

    if grep -rn "DEBUG.*=.*true\|debug.*:.*true" \
       --include='*.ts' --include='*.js' --include='*.env' --include='*.json' "$PROJECT_DIR" 2>/dev/null | \
       grep -qv "test\|spec"; then
        warn "A05: Debug mode may be enabled"
        config_issues=$((config_issues + 1))

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 442)May include surrounding context.

sh
# Sensitive files
    log "Checking sensitive file permissions..."
    for f in .env .env.local .env.* *.pem *.key id_rsa id_ed25519 credentials.json; do
        if [ -f "$PROJECT_DIR/$f" ]; then
            local perms=$(stat -c %a "$PROJECT_DIR/$f" 2>/dev/null || stat -f %Lp "$PROJECT_DIR/$f" 2>/dev/null)
            if [ "${perms:-644}" -gt 644 ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 442)May include surrounding context.

sh
# Sensitive files
    log "Checking sensitive file permissions..."
    for f in .env .env.local .env.* *.pem *.key id_rsa id_ed25519 credentials.json; do
        if [ -f "$PROJECT_DIR/$f" ]; then
            local perms=$(stat -c %a "$PROJECT_DIR/$f" 2>/dev/null || stat -f %Lp "$PROJECT_DIR/$f" 2>/dev/null)
            if [ "${perms:-644}" -gt 644 ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/security-audit.sh (reported line 442)May include surrounding context.

sh
# Sensitive files
    log "Checking sensitive file permissions..."
    for f in .env .env.local .env.* *.pem *.key id_rsa id_ed25519 credentials.json; do
        if [ -f "$PROJECT_DIR/$f" ]; then
            local perms=$(stat -c %a "$PROJECT_DIR/$f" 2>/dev/null || stat -f %Lp "$PROJECT_DIR/$f" 2>/dev/null)
            if [ "${perms:-644}" -gt 644 ]; then

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill exposes extensive shell-based capabilities throughout the document, but the metadata does not declare any tool scope such as allowed-tools or permissions. In an agent environment, this creates an implicit-privilege problem where consumers may execute powerful filesystem, network, and package-management commands without an explicit trust boundary.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
65% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

md
**Checklist:**
- [ ] Every endpoint verifies authentication
- [ ] Every data access verifies authorization
- [ ] CORS configured with specific origins (not `*`)
- [ ] Rate limiting on sensitive endpoints
- [ ] JWT tokens validated on every request

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
65% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

md
grep -rn "DEBUG\s*=\s*true\|debug:\s*true\|NODE_ENV.*development" \
  --include='*.ts' --include='*.js' --include='*.env' --include='*.yaml' --include='*.json' .

# Find CORS wildcard
grep -rn "Access-Control-Allow-Origin.*\*\|cors({.*origin.*true" \
  --include='*.ts' --include='*.js' .

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

Using npx audit-ci without pinning a version allows the latest package version to be fetched at runtime, which weakens supply-chain integrity and makes builds non-reproducible. If the upstream package or one of its transitive dependencies is compromised, the skill could execute attacker-controlled code during audit runs.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
// Validate before use
async function fetchPrice(token: string): Promise<number> {
  const response = await fetch(`https://api.example.com/price/${token}`)
  const data = await response.json()

  // Validate response