Back to skill

Security audit

Snyk Vulnerability Scanner

Security checks for vulnerabilities and agentic risk

Overview

The skill broadly matches its security-scanning purpose, but its dry-run workflow can still create real GitHub issues using the user's credentials.

Review carefully before installing. Do not rely on the full workflow's dry-run mode until it is fixed; prefer scan-only or explicitly skip issue and fix steps. Use least-privilege GitHub and Snyk credentials, verify the exact GitHub repository target, avoid scheduled write-capable runs, and inspect generated changes before allowing commits, pushes, issues, or PRs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/run-full-workflow.sh:103
Finding

Dry-run mode still creates real GitHub issues

Content
View full analysis
&1 | sed 's/Created:/[DRY RUN] Would create:/' || true else python3 "$SCRIPT_DIR/create-github-issues.py" "$OUTPUT_FILE" "$REPO_URL" || { echo -e "${YELLOW}Issue creation completed with warnings${NC}" } fi ``` The invoked Python script performs the real operation: ```python if create_issue(owner, repo, title, body): print(f" Created: {title}") created_count += 1 else: print(f" Failed to create: {title}") ``` ### Technical Analysis The dry-run branch invokes `create-github-issues.py` without passing any option that suppresses GitHub writes. The `sed` command only rewrites the subprocess's displayed output from `Created:` to `[DRY RUN] Would create:`. It does not intercept or disable the authenticated `gh issue create` requests executed by the Python process. Consequently, the workflow presents an operation as a simulation while using the authenticated GitHub CLI to make persistent changes. This violates the documented guarantee that dry-run mode performs no changes. ### Attack Path 1. The user authenticates GitHub CLI with write access to a target repository. 2. The workflow is invoked with `dry-run=true` and `skip-issues=false`. 3. The Snyk scan finds one or more vulnerabilities. 4. The dry-run branch executes `create-github-issues.py`. 5. The Python script invokes `gh issue create` for each applicable package. 6. Real GitHub issues are created, while the output is rewritten to claim they only would have been created. ### ...[truncated 438 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create-github-issues.py:20
Finding

Unvalidated repository hostname permits GitHub target confusion

Content
View full analysis
= 2: return path_parts[0], path_parts[1].replace('.git', '') return None, None ``` The path-derived values are accepted and later used as a GitHub target: ```python owner, repo = extract_repo_info(repo_url) if not owner or not repo: print(f"Error: Could not extract repo info from URL: {repo_url}") sys.exit(1) print(f"Processing {len(vulns)} vulnerabilities for {owner}/{repo}...") ``` ```python if create_issue(owner, repo, title, body): print(f" Created: {title}") created_count += 1 else: print(f" Failed to create: {title}") ``` ### Technical Analysis `extract_repo_info()` parses only the first two URL path components. It does not verify that the scheme is HTTPS, that the hostname is exactly `github.com`, or that the owner and repository components follow valid GitHub identifier rules. As a result, a URL such as `https://attacker.example/target-owner/target-repository` is interpreted as the GitHub repository `target-owner/target-repository`. The scanning scripts may clone from one host, while the issue-generation script writes to an unrelated repository on GitHub. This creates a confused-target condition between the source repository and the authenticated GitHub API destination. The use of a subprocess argument array prevents shell injection, but it does not prevent logical repository redirection. ### Attack Path 1. An attacker or untrusted automation supplies a cloneable n ...[truncated 969 chars]
Remediation
View remediation
/[.git]`. - Verify that `parsed.scheme == "https"` and that `parsed.hostname` is exactly `github.com`. - Reject embedded credentials, unexpected ports, query strings, fragments, and additional path components. - Validate owner and repository names against conservative allowlisted character patterns. - Canonicalize and confirm the target with a non-mutating command such as `gh repo view owner/repo --json nameWithOwner,url`. - Derive the GitHub target from the cloned repository's verified canonical origin rather than independently interpreting arbitrary path components. - Display the resolved source and destination and require confirmation before mutating a repository when they do not match. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run-full-workflow.sh:72
Finding

Predictable shared temporary result file permits symlink-based file overwrite

Content
View full analysis
/dev/null || basename "$REPO_URL" .git) OUTPUT_FILE="/tmp/snyk-${REPO_NAME}-${TIMESTAMP}.json" ``` The predictable path is passed to the scan script and opened using ordinary shell redirection: ```bash echo "Running Snyk test with severity filter: $SEVERITY_FILTER" # Run snyk test and output JSON snyk test --severity-threshold=${SEVERITY_FILTER%,*} --json --all-projects > "$OUTPUT_FILE" 2>/dev/null || true ``` ### Technical Analysis The result path is created directly in the shared `/tmp` directory. Its name is derived from the repository name and a timestamp with one-second resolution, making candidate names predictable. No private parent directory, exclusive file creation, ownership verification, or symlink check is used. Shell redirection follows symbolic links. A local attacker who can write to `/tmp` can pre-create a symbolic link at a predicted result path. When the workflow opens that path, the shell follows the link and truncates or replaces the linked destination with Snyk JSON output, subject to the workflow user's filesystem permissions. Although the clone scripts use `mktemp -d` for repository directories, the full workflow's scan result is not placed inside one of those protected directories. ### Attack Path 1. A local attacker determines or guesses the repository name and likely execution second. 2. The attacker creates one or more symbolic links such as `/tmp/snyk-repository-YYYYMMDD_HHMMSS.json`. 3. Each symlink points to a file writable by the account running the workflow. 4. The workflow constructs the matching predictable pathname. 5. Shell redirection foll ...[truncated 628 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broader automation skill with three main capabilities: running Snyk scans, reporting findings as GitHub issues, and creating automatic fix PRs. This code chunk only covers one subset of that description: converting existing Snyk scan output into GitHub issues. It does not invoke Snyk, authenticate to Snyk, generate pull requests, apply fixes, or interact with branches. The repository access it uses is limited to GitHub issue operations via the gh CLI. Because key advertised capabilities are absent from the actual code chunk, the description does not accurately represent what this supplied code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code substantially matches the auto-fix PR portion of the description: it scans with Snyk, applies automated fixes, commits/pushes changes, and creates a PR to the dev branch by default. It also aligns with the stated need for Snyk CLI and GitHub CLI authentication and repository access. However, the declared description explicitly includes GitHub issue reporting and generating vulnerability reports as GitHub issues, and there is no issue creation logic in the script. The script only creates pull requests and console output/artifact files. That omission is a material description-to-behavior mismatch because issue reporting is presented as a supported use case. The jq point is a minor implementation inconsistency rather than a primary purpose mismatch, but the main reason for mismatch is the missing GitHub issue reporting capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code’s actual behavior is limited to repository cloning and Snyk scanning with JSON output. That aligns with part of the description about scanning repositories for vulnerabilities, but the description substantially overstates functionality by claiming GitHub issue generation and auto-fix pull request creation. The script contains no gh/GitHub API usage, no issue creation, no branch management, and no PR logic. It also only checks Snyk authentication, not GitHub authentication, despite the declared requirements. Therefore the description does not accurately represent the implemented behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documentation directs use of shell commands, networked CLIs, repository writes, and file processing, but it declares no explicit tool scope or permission boundaries. In an agent environment, this increases the chance the skill is invoked with broader capabilities than intended, enabling repository modification, issue creation, or external network actions without clear authorization constraints.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
71% confidence
Finding

The skill explicitly relies on persistent authenticated Snyk and GitHub CLI sessions and repository write access, which means later executions can inherit powerful credentials without re-consent. In an agent or shared environment, persistent session state raises the risk of unauthorized scans, issue creation, PR creation, or modification of unintended repositories if the skill is triggered in the wrong context.

Content

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

md
1. **Snyk CLI** is installed: `npm install -g snyk` and authenticated: `snyk auth`
2. **GitHub CLI** is installed: `brew install gh` and authenticated: `gh auth login`
3. **jq** is installed: `brew install jq` (for JSON processing)
4. You have **write access** to the target repository

## Workflow

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The duplicate-detection logic does not actually enforce 'one issue per package'; it only checks whether the severity prefix like '[HIGH' appears in an existing title. That can cause unrelated packages with the same severity to be skipped, suppressing vulnerability reporting and creating blind spots in a security workflow that is supposed to open tracking issues for discovered flaws.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/create-github-issues.py (reported line 18)May include surrounding context.

python
def run_gh_command(args):
    """Run a GitHub CLI command and return output."""
    cmd = ['gh'] + args
    result = subprocess.run(cmd, capture_output=True, text=True)
    return result

def extract_repo_info(repo_url):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script verifies existing GitHub and Snyk authentication and then proceeds to clone and later modify a remote repository, but it does not present an explicit upfront warning that authenticated accounts and remote resources will be used. In an agent/automation context, this increases the risk of a user or calling system triggering actions with real credentials and repository access without fully appreciating the scope of side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section automatically runs snyk fix, stages all changes with git add -, and creates a commit without any interactive confirmation or policy gate. In a skill designed for repository automation, that means dependency and possibly other generated file changes can be applied and committed immediately, which is risky if the repository URL is wrong, the fixes are unsafe, or the repo contains unexpected project structures.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script pushes a new branch to origin and creates a GitHub pull request automatically, again without an explicit confirmation prompt. Because it operates with the user's authenticated GitHub CLI context, a mistaken or malicious invocation could publish changes to a real repository and create visible workflow artifacts, making the impact higher than local-only automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This shell script performs safety-relevant filesystem operations by cloning a repository into a temporary directory and writing scan results to an output file. Although it logs what it is doing, it does not clearly disclose up front that executing the skill will create local files and may overwrite the specified output path.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.