Security Scan
Version: 1.0.0
Run the bundled scanner first, then manually validate anything high-signal before drawing conclusions.
Answer two questions:
- What third-party code or add-ons are present?
- Which files or package sources deserve closer review?
Quick Start
- Run
python3 scripts/security_scan.py <target-path>.
- Read
Findings by Severity and Flagged Files first, then use Third-Party Inventory to understand both manifests and lockfiles.
- Open the referenced files for any
high or medium issue.
- Describe findings as
flagged, suspicious, risky, or requires review.
- Do not call code or a package malicious without direct evidence.
What The Script Covers
Inventory these common ecosystems and add-on formats:
package.json dependencies and npm lifecycle scripts
package-lock.json, yarn.lock, and pnpm-lock.yaml
requirements*.txt and pyproject.toml
poetry.lock
Cargo.toml and Cargo.lock
Gemfile and Gemfile.lock
go.mod, composer.json, pom.xml, build.gradle*, and Package.swift
.csproj and packages.config
- Browser extension
manifest.json
- JetBrains
plugin.xml
- GitHub Actions workflow files in
.github/workflows/*.yml
Dockerfile*, docker-compose.yml, and compose.yaml
Flag these local risk indicators:
- Direct URL, Git, or repo-based dependency sources
- Lockfiles that resolve packages to direct tarballs, repositories, or other non-registry sources
- Suspicious install hooks like
preinstall or postinstall
- Shell pipelines that download and execute remote code
- Dynamic execution patterns like
eval, new Function, or subprocess spawning
- Large base64-like blobs in source
- Sensitive browser extension permissions such as
<all_urls>, debugger, nativeMessaging, or proxy
- GitHub Actions that use third-party actions without a full commit SHA pin
- Docker and Compose configurations that use floating base images, remote
ADD, privileged mode, host namespaces, root users, or dangerous host mounts
Expected Workflow
1. Run the local scan
Prefer text output:
python3 scripts/security_scan.py <target-path>
Use JSON only when another tool will consume the results:
python3 scripts/security_scan.py <target-path> --format json
2. Validate high-signal findings
For each high or medium finding:
- Open the referenced file.
- Confirm the pattern is real and not benign test data.
- Explain why it matters in plain language.
- State what additional review is still needed if certainty is limited.
3. Deliver a careful report
Always include:
- The list of directories scanned
- The flagged files, with why they were flagged
- The full file list
- Each noteworthy finding attached to the file where it was found
- A concise inventory of third-party components
- A short note on scan limits
Response Template
Use this structure when summarizing results:
Directories scanned
- <directory>
Flagged files
- <file>: <severity> <issue>
Files scanned
- <file>: OK
- <file>: <severity> <issue>
Third-party inventory
- <component>: <ecosystem/type>, version/source, where it was found
Limits
- This is a local heuristic scan. It can identify risky patterns, but it cannot prove a package is malicious without stronger evidence.
When To Go Beyond The Script
Inspect files manually when:
- The project uses an unsupported dependency format
- The scanner flags lifecycle scripts or extension permissions
- The code downloads executables, runs shell commands, or decodes hidden payloads
- The user specifically asks whether a package is known to be malicious
If browsing is available and the user wants deeper verification, confirm package ownership and advisories through official registries, vendor docs, and the source repository.
1---2name: security-scan-33description: Scan a local code or plugin directory for third-party dependencies, lockfiles, extensions, workflow actions, container definitions, risky install hooks, suspicious code patterns, and unusually powerful permissions. Use when the user wants a security-oriented pass over a repository, generated app, browser extension, IDE plugin, CI workflow, Docker setup, or other development folder to identify what is installed and what deserves deeper review.4---5
6# Security Scan
7
8Version: `1.0.0`
9
10Run the bundled scanner first, then manually validate anything high-signal before drawing conclusions.
11
12Answer two questions:
13
141. What third-party code or add-ons are present?
152. Which files or package sources deserve closer review?
16
17## Quick Start
18
191. Run `python3 scripts/security_scan.py <target-path>`.
202. Read `Findings by Severity` and `Flagged Files` first, then use `Third-Party Inventory` to understand both manifests and lockfiles.
213. Open the referenced files for any `high` or `medium` issue.
224. Describe findings as `flagged`, `suspicious`, `risky`, or `requires review`.
235. Do not call code or a package malicious without direct evidence.
24
25## What The Script Covers
26
27Inventory these common ecosystems and add-on formats:
28
29- `package.json` dependencies and npm lifecycle scripts
30- `package-lock.json`, `yarn.lock`, and `pnpm-lock.yaml`
31- `requirements*.txt` and `pyproject.toml`
32- `poetry.lock`
33- `Cargo.toml` and `Cargo.lock`
34- `Gemfile` and `Gemfile.lock`
35- `go.mod`, `composer.json`, `pom.xml`, `build.gradle*`, and `Package.swift`
36- `.csproj` and `packages.config`
37- Browser extension `manifest.json`
38- JetBrains `plugin.xml`
39- GitHub Actions workflow files in `.github/workflows/*.yml`
40- `Dockerfile*`, `docker-compose.yml`, and `compose.yaml`
41
42Flag these local risk indicators:
43
44- Direct URL, Git, or repo-based dependency sources
45- Lockfiles that resolve packages to direct tarballs, repositories, or other non-registry sources
46- Suspicious install hooks like `preinstall` or `postinstall`
47- Shell pipelines that download and execute remote code
48- Dynamic execution patterns like `eval`, `new Function`, or subprocess spawning
49- Large base64-like blobs in source
50- Sensitive browser extension permissions such as `<all_urls>`, `debugger`, `nativeMessaging`, or `proxy`
51- GitHub Actions that use third-party actions without a full commit SHA pin
52- Docker and Compose configurations that use floating base images, remote `ADD`, privileged mode, host namespaces, root users, or dangerous host mounts
53
54## Expected Workflow
55
56### 1. Run the local scan
57
58Prefer text output:
59
60```bash
61python3 scripts/security_scan.py <target-path>
62```
63
64Use JSON only when another tool will consume the results:
65
66```bash
67python3 scripts/security_scan.py <target-path> --format json
68```
69
70### 2. Validate high-signal findings
71
72For each `high` or `medium` finding:
73
74- Open the referenced file.
75- Confirm the pattern is real and not benign test data.
76- Explain why it matters in plain language.
77- State what additional review is still needed if certainty is limited.
78
79### 3. Deliver a careful report
80
81Always include:
82
83- The list of directories scanned
84- The flagged files, with why they were flagged
85- The full file list
86- Each noteworthy finding attached to the file where it was found
87- A concise inventory of third-party components
88- A short note on scan limits
89
90## Response Template
91
92Use this structure when summarizing results:
93
94```markdown
95Directories scanned
96- <directory>
97
98Flagged files
99- <file>: <severity> <issue>
100
101Files scanned
102- <file>: OK
103- <file>: <severity> <issue>
104
105Third-party inventory
106- <component>: <ecosystem/type>, version/source, where it was found
107
108Limits
109- This is a local heuristic scan. It can identify risky patterns, but it cannot prove a package is malicious without stronger evidence.
110```
111
112## When To Go Beyond The Script
113
114Inspect files manually when:
115
116- The project uses an unsupported dependency format
117- The scanner flags lifecycle scripts or extension permissions
118- The code downloads executables, runs shell commands, or decodes hidden payloads
119- The user specifically asks whether a package is known to be malicious
120
121If browsing is available and the user wants deeper verification, confirm package ownership and advisories through official registries, vendor docs, and the source repository.