deepscan-cli 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +5 -0
- package/README.md +224 -61
- package/dist/bin/deepscan.js +189 -71
- package/dist/bin/deepscan.js.map +1 -1
- package/dist/{chunk-OSYJXVNF.js → chunk-4TWV5TES.js} +5130 -610
- package/dist/chunk-4TWV5TES.js.map +1 -0
- package/dist/index.d.ts +62 -5
- package/dist/index.js +13 -3
- package/package.json +38 -12
- package/rules/built-in/default-config.yml +28 -3
- package/rules/built-in/operations.yml +287 -0
- package/rules/built-in/security.yml +12 -6
- package/dist/chunk-OSYJXVNF.js.map +0 -1
- package/rules/built-in/converted-semgrep.yml +0 -37
- package/rules/built-in/semgrep-apex.yml +0 -336
- package/rules/built-in/semgrep-bash.yml +0 -362
- package/rules/built-in/semgrep-c.yml +0 -429
- package/rules/built-in/semgrep-clojure.yml +0 -166
- package/rules/built-in/semgrep-csharp.yml +0 -1260
- package/rules/built-in/semgrep-dart.yml +0 -21
- package/rules/built-in/semgrep-dockerfile.yml +0 -874
- package/rules/built-in/semgrep-elixir.yml +0 -146
- package/rules/built-in/semgrep-generic.yml +0 -2945
- package/rules/built-in/semgrep-go.yml +0 -2898
- package/rules/built-in/semgrep-hcl.yml +0 -8181
- package/rules/built-in/semgrep-html.yml +0 -94
- package/rules/built-in/semgrep-java.yml +0 -4219
- package/rules/built-in/semgrep-javascript.yml +0 -6243
- package/rules/built-in/semgrep-json.yml +0 -360
- package/rules/built-in/semgrep-kotlin.yml +0 -540
- package/rules/built-in/semgrep-lua.yml +0 -46
- package/rules/built-in/semgrep-ocaml.yml +0 -773
- package/rules/built-in/semgrep-php.yml +0 -1638
- package/rules/built-in/semgrep-python.yml +0 -11240
- package/rules/built-in/semgrep-regex.yml +0 -6444
- package/rules/built-in/semgrep-ruby.yml +0 -2687
- package/rules/built-in/semgrep-rust.yml +0 -278
- package/rules/built-in/semgrep-scala.yml +0 -807
- package/rules/built-in/semgrep-sh.yml +0 -46
- package/rules/built-in/semgrep-solidity.yml +0 -1046
- package/rules/built-in/semgrep-swift.yml +0 -200
- package/rules/built-in/semgrep-terraform.yml +0 -147
- package/rules/built-in/semgrep-typescript.yml +0 -6212
- package/rules/built-in/semgrep-xml.yml +0 -31
- package/rules/built-in/semgrep-yaml.yml +0 -2785
- package/rules/examples/custom-api-security.yml +0 -66
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
**The 100% Free, Lightning-Fast Alternative to Commercial SAST Tools.**
|
|
6
6
|
*Zero False Positives Architecture • AST-Powered Context • AI Auto-Remediation*
|
|
7
7
|
|
|
8
|
-
[](https://www.npmjs.com/package/deepscan-cli)
|
|
9
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
9
10
|
[](https://nodejs.org)
|
|
10
11
|
[](http://makeapullrequest.com)
|
|
11
12
|
[](https://github.com/topics/devsecops)
|
|
@@ -20,20 +21,27 @@ Tired of commercial tools like SonarQube, Checkmarx, or Semgrep drowning your CI
|
|
|
20
21
|
|
|
21
22
|
## ✨ Why Choose DeepScan? (Features)
|
|
22
23
|
|
|
23
|
-
### 🛡️ Enterprise-Grade SAST
|
|
24
|
+
### 🛡️ Enterprise-Grade SAST & Container IaC
|
|
24
25
|
- **Injection Detection** — Catch SQLi, Command Injection, Code Injection, and SSRF.
|
|
25
26
|
- **XSS & Frontend Security** — Deep DOM analysis (`innerHTML`, `document.write`, React/Vue sinks).
|
|
26
27
|
- **Advanced Secrets Detection** — Flag hardcoded passwords, API keys, and high-entropy tokens with zero test-file noise.
|
|
27
28
|
- **Crypto & Auth** — Prevent weak hashing (MD5/SHA1), insecure JWTs, and session misconfigurations.
|
|
29
|
+
- **Dockerfile & Compose IaC** — Flag root final stages, hardcoded `ENV`/`ARG` secrets, remote `ADD`/`curl | sh`, `privileged: true`, and `docker.sock` mounts.
|
|
28
30
|
|
|
29
|
-
###
|
|
31
|
+
### ⚙️ Operations & OOM-Kill Reliability (`--ops`)
|
|
32
|
+
- **OOM & Unbounded Memory** — Detect API/DB queries loading entire tables without pagination (`findMany()`, `::all()`, `SELECT *` without `LIMIT`), uncapped client `limit` parameters, unbounded body/file buffering, and unbounded in-memory caches.
|
|
33
|
+
- **Timeouts & Resilience** — Flag outbound HTTP calls without timeouts, infinite retry loops without max attempts, and unlimited connection pool settings.
|
|
34
|
+
- **Resource & Connection Leaks** — Catch unclosed HTTP responses/DB handles, uncleaned timers/listeners, and DB/cache clients instantiated per request.
|
|
35
|
+
- **Operational Bottlenecks** — Identify N+1 queries inside loops, blocking synchronous I/O/crypto in async route handlers, unbounded `Promise.all` fan-out, and ReDoS patterns.
|
|
36
|
+
|
|
37
|
+
### 📊 Code Quality & Clean Code (opt-in via `--quality`)
|
|
30
38
|
- **Complexity Analysis** — Enforce Cyclomatic & Cognitive complexity limits.
|
|
31
|
-
- **Code Duplication** —
|
|
32
|
-
- **Code Smells** — Catch magic numbers, empty catch blocks, and tech debt (TODO/FIXME).
|
|
39
|
+
- **Code Duplication** — Semantic duplicate block detection with coalesced reporting.
|
|
40
|
+
- **Code Smells** — Catch unused imports, magic numbers, empty catch blocks, and tech debt (TODO/FIXME).
|
|
33
41
|
|
|
34
|
-
### 🔗 SCA & Dependency Scanning (
|
|
35
|
-
- **Universal Package Support** —
|
|
36
|
-
- **
|
|
42
|
+
### 🔗 Lockfile-First SCA & Dependency Scanning (`--cve`)
|
|
43
|
+
- **Universal Package & Lockfile Support** — `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lock`, `uv.lock`, `poetry.lock`, `Pipfile.lock`, `go.sum`/`go.mod`, `gradle.lockfile`/`libs.versions.toml`/`pom.xml`, `Cargo.lock`, `composer.lock`, `Gemfile.lock`, NuGet.
|
|
44
|
+
- **Zero Minimum-Range False Positives** — Monorepo-aware lockfile resolution strictly prioritizes exact locked versions over manifest minimum ranges (e.g., `^1.0.0`) and caches OSV.dev queries locally.
|
|
37
45
|
|
|
38
46
|
### 🧠 Next-Gen Capabilities (The "Secret Sauce")
|
|
39
47
|
- **AST-Powered False Positive Reduction** — DeepScan understands code. It knows the difference between a password in a test fixture vs. production code.
|
|
@@ -50,6 +58,8 @@ Scan your entire monorepo without installing 10 different tools:
|
|
|
50
58
|
|
|
51
59
|
### Installation
|
|
52
60
|
|
|
61
|
+
Install globally from [npm](https://www.npmjs.com/package/deepscan-cli):
|
|
62
|
+
|
|
53
63
|
```bash
|
|
54
64
|
npm install -g deepscan-cli
|
|
55
65
|
```
|
|
@@ -60,11 +70,15 @@ npm install -g deepscan-cli
|
|
|
60
70
|
# Initialize configuration
|
|
61
71
|
deepscan init
|
|
62
72
|
|
|
63
|
-
# Scan current directory
|
|
73
|
+
# Scan current directory (defaults to: security + ops)
|
|
64
74
|
deepscan scan
|
|
65
75
|
|
|
66
|
-
#
|
|
67
|
-
deepscan scan ./src
|
|
76
|
+
# Explicitly include quality & lockfile-first CVE scanners
|
|
77
|
+
deepscan scan ./src --scanners security,ops,quality,cve
|
|
78
|
+
|
|
79
|
+
# Save a baseline on legacy repos and fail CI only on newly introduced findings
|
|
80
|
+
deepscan scan ./src --save-baseline .deepscan-baseline.json
|
|
81
|
+
deepscan scan ./src --baseline .deepscan-baseline.json --fail-on critical,high
|
|
68
82
|
|
|
69
83
|
# Scan with specific format output
|
|
70
84
|
deepscan scan ./src --format json --output results.json
|
|
@@ -103,15 +117,18 @@ scanners:
|
|
|
103
117
|
enabled: true
|
|
104
118
|
severity: [critical, high, medium]
|
|
105
119
|
quality:
|
|
106
|
-
enabled: true
|
|
120
|
+
enabled: false # opt-in via --quality or enabled: true
|
|
107
121
|
thresholds:
|
|
108
122
|
maxComplexity: 15
|
|
109
123
|
maxFileLength: 500
|
|
110
124
|
maxFunctionLength: 50
|
|
111
125
|
cve:
|
|
112
|
-
enabled: true
|
|
126
|
+
enabled: false # opt-in via --cve or enabled: true
|
|
113
127
|
sources: [osv]
|
|
114
128
|
failOnSeverity: critical
|
|
129
|
+
ops:
|
|
130
|
+
enabled: true
|
|
131
|
+
severity: [critical, high, medium, low]
|
|
115
132
|
|
|
116
133
|
rules:
|
|
117
134
|
include: ["*"]
|
|
@@ -186,8 +203,9 @@ deepscan scan --rules ./my-rules/
|
|
|
186
203
|
|
|
187
204
|
| Option | Shortcut | Description | Default | Example |
|
|
188
205
|
| :--- | :--- | :--- | :--- | :--- |
|
|
189
|
-
| `--scanners <names>` | `-s` | Comma-separated list of scanner engines to run (`security`, `quality`, `cve`) | `security,
|
|
206
|
+
| `--scanners <names>` | `-s` | Comma-separated list of scanner engines to run (`security`, `ops`, `quality`, `cve`) | `security,ops` | `deepscan scan -s security,ops,cve` |
|
|
190
207
|
| `--security` | N/A | Run security scanner only | N/A | `deepscan scan --security` |
|
|
208
|
+
| `--ops` | N/A | Run operational & OOM reliability scanner only | N/A | `deepscan scan --ops` |
|
|
191
209
|
| `--quality` | N/A | Run quality scanner only | N/A | `deepscan scan --quality` |
|
|
192
210
|
| `--cve` | N/A | Run CVE/dependency scanner only | N/A | `deepscan scan --cve` |
|
|
193
211
|
| `--format <format>` | `-f` | Output format: `json`, `csv`, `html`, `sarif`, `console` | `console` | `deepscan scan -f html` |
|
|
@@ -223,6 +241,54 @@ deepscan report convert results.json --to html --output report.html
|
|
|
223
241
|
|
|
224
242
|
---
|
|
225
243
|
|
|
244
|
+
## 🤖 GitHub Actions (CI/CD & Code Scanning)
|
|
245
|
+
|
|
246
|
+
Run DeepScan automatically on every push and pull request, detect security & OOM-kill bugs, and upload SARIF results directly to the **GitHub Security → Code Scanning** tab:
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
name: DeepScan Security & Ops Check
|
|
250
|
+
|
|
251
|
+
on:
|
|
252
|
+
push:
|
|
253
|
+
branches: [main]
|
|
254
|
+
pull_request:
|
|
255
|
+
branches: [main]
|
|
256
|
+
|
|
257
|
+
permissions:
|
|
258
|
+
contents: read
|
|
259
|
+
security-events: write
|
|
260
|
+
|
|
261
|
+
jobs:
|
|
262
|
+
deepscan:
|
|
263
|
+
runs-on: ubuntu-latest
|
|
264
|
+
steps:
|
|
265
|
+
- uses: actions/checkout@v4
|
|
266
|
+
|
|
267
|
+
- name: Run DeepScan (SAST + Ops/OOM-Kill)
|
|
268
|
+
uses: maiductuan/code-security-scanner@v1.2.0
|
|
269
|
+
with:
|
|
270
|
+
path: '.'
|
|
271
|
+
scanners: 'security,ops'
|
|
272
|
+
fail-on: 'critical,high'
|
|
273
|
+
upload-sarif: 'true'
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Action Inputs
|
|
277
|
+
|
|
278
|
+
| Input | Description | Default |
|
|
279
|
+
| :--- | :--- | :--- |
|
|
280
|
+
| `path` | Target path to scan | `.` |
|
|
281
|
+
| `scanners` | Comma-separated scanners (`security,ops,quality,cve`) | `security,ops` |
|
|
282
|
+
| `severity` | Severities to report (`critical,high,medium,low`) | `critical,high,medium,low` |
|
|
283
|
+
| `fail-on` | Severities that fail the job (`none` to never fail) | `critical,high` |
|
|
284
|
+
| `format` | Output format (`sarif`, `json`, `html`, `csv`, `console`) | `sarif` |
|
|
285
|
+
| `output` | Output report file path | `deepscan-results.sarif` |
|
|
286
|
+
| `upload-sarif` | Upload SARIF report to GitHub Code Scanning | `true` |
|
|
287
|
+
| `baseline` | Optional baseline JSON file path to ignore existing findings | `""` |
|
|
288
|
+
| `deep` | Enable taint flow & semantic analysis | `false` |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
226
292
|
## 🤖 AI-Assisted Validation
|
|
227
293
|
|
|
228
294
|
Enable AI validation to reduce false positives (optional):
|
|
@@ -258,6 +324,7 @@ CLI → Pipeline → File Discovery → Language Detection
|
|
|
258
324
|
↓
|
|
259
325
|
Scanner Engines (parallel)
|
|
260
326
|
├── Security Scanner (patterns, taint, context)
|
|
327
|
+
├── Operations Scanner (OOM-kill, timeouts, leaks, N+1)
|
|
261
328
|
├── Quality Scanner (complexity, duplication, metrics)
|
|
262
329
|
└── CVE Scanner (dependency parsing, OSV query)
|
|
263
330
|
↓
|
|
@@ -270,21 +337,20 @@ CLI → Pipeline → File Discovery → Language Detection
|
|
|
270
337
|
|
|
271
338
|
---
|
|
272
339
|
|
|
273
|
-
## 📊 Comparison
|
|
274
|
-
|
|
275
|
-
| Feature | DeepScan | SonarQube | Semgrep | Trivy |
|
|
276
|
-
|
|
277
|
-
| SAST | ✅ |
|
|
278
|
-
| SCA/CVE | ✅ |
|
|
279
|
-
| Secrets | ✅ | ✅ | ✅ | ✅ |
|
|
280
|
-
| Context-Aware | ✅ |
|
|
281
|
-
| Taint
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
|
285
|
-
| HTML
|
|
286
|
-
|
|
|
287
|
-
| Free & Open Source | ✅ | Partial | Partial | ✅ |
|
|
340
|
+
## 📊 Feature Comparison
|
|
341
|
+
|
|
342
|
+
| Feature | DeepScan | SonarQube Community | Semgrep OSS | Trivy | Gitleaks |
|
|
343
|
+
|---------|:--------:|:-------------------:|:-----------:|:-----:|:--------:|
|
|
344
|
+
| **SAST (13 Languages)** | ✅ (13/13) | ⚠️ (7/13 — C/C++/Swift Paywalled, Rust Unsupported, Java/C# require build) | ✅ | ❌ | ❌ |
|
|
345
|
+
| **SCA / CVE (Transitive Lockfiles, NuGet, Gradle TOML)** | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
346
|
+
| **Secrets & Standalone Cert/Config (`.pem`, `.key`, `.env`, `.conf`)** | ✅ | ⚠️ Partial | ✅ | ✅ | ✅ |
|
|
347
|
+
| **AST & Sanitizer Context-Aware FP Filtering** | ✅ | ⚠️ Partial | ⚠️ Partial | ❌ | ❌ |
|
|
348
|
+
| **Inter-Procedural Taint Tracking** | ✅ | ❌ (Paid Edition) | ⚠️ (Pro Engine) | ❌ | ❌ |
|
|
349
|
+
| **Code Quality, Complexity & Duplication** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
350
|
+
| **AI-Assisted Validation & Auto-Remediation** | ✅ | ❌ | ⚠️ (Cloud Paid) | ❌ | ❌ |
|
|
351
|
+
| **Zero Infrastructure (Single CLI)** | ✅ | ❌ (Requires Server + DB) | ✅ | ✅ | ✅ |
|
|
352
|
+
| **Custom Rules (YAML) & SARIF / HTML Reports** | ✅ | ❌ | ✅ | ✅ | ✅ |
|
|
353
|
+
| **100% Free & Open Source** | ✅ | Partial | Partial | ✅ | ✅ |
|
|
288
354
|
|
|
289
355
|
---
|
|
290
356
|
|
|
@@ -302,8 +368,8 @@ This section is intended for developers and users who want to run DeepScan from
|
|
|
302
368
|
### Setup
|
|
303
369
|
Clone the repository and install all dependencies:
|
|
304
370
|
```bash
|
|
305
|
-
git clone https://github.com/
|
|
306
|
-
cd code-
|
|
371
|
+
git clone https://github.com/maiductuan/code-security-scanner.git
|
|
372
|
+
cd code-security-scanner
|
|
307
373
|
npm install
|
|
308
374
|
```
|
|
309
375
|
|
|
@@ -360,60 +426,157 @@ npm run lint
|
|
|
360
426
|
```
|
|
361
427
|
|
|
362
428
|
### Rule & Script Development
|
|
363
|
-
- To
|
|
429
|
+
- To validate DeepScan's built-in rulesets ([security.yml](./rules/built-in/security.yml), [quality.yml](./rules/built-in/quality.yml), [operations.yml](./rules/built-in/operations.yml)) after editing rules:
|
|
364
430
|
```bash
|
|
365
|
-
|
|
431
|
+
npm run rules:update
|
|
432
|
+
```
|
|
433
|
+
- Optional local helper for converting your own custom YAML rules into DeepScan custom rule format:
|
|
434
|
+
```bash
|
|
435
|
+
npx tsx scripts/convert-rules.ts --input tests/fixtures/semgrep-sample.yml --output ./my-rules/converted.yml
|
|
436
|
+
```
|
|
437
|
+
- Run the test suite:
|
|
438
|
+
```bash
|
|
439
|
+
npm run test
|
|
366
440
|
```
|
|
367
|
-
- To run the full automated download/convert script:
|
|
368
|
-
1. Make changes inside [scripts/update-rules.ts](file:///d:/code/code-scan-security/scripts/update-rules.ts).
|
|
369
|
-
2. Execute the update script:
|
|
370
|
-
```bash
|
|
371
|
-
npm run rules:update
|
|
372
|
-
```
|
|
373
|
-
3. Run the test suite:
|
|
374
|
-
```bash
|
|
375
|
-
npm run test
|
|
376
|
-
```
|
|
377
441
|
|
|
378
442
|
---
|
|
379
443
|
|
|
380
444
|
## 📊 Benchmark & Accuracy Results
|
|
381
445
|
|
|
382
|
-
|
|
446
|
+
We validate DeepScan using a **two-tier evaluation methodology**:
|
|
447
|
+
1. **Ground-Truth Monorepo Evaluation (`examples/`)**: Measures exact **Recall** and **Precision** against paired vulnerable and remediated ("safe") implementations.
|
|
448
|
+
2. **Global 39-Repository Open-Source Benchmark (13 Languages × 3 Tiers = 9,230 Files)**: Head-to-head comparison against **Semgrep (`p/default`)**, **Trivy (`vuln,secret`)**, **Gitleaks**, and **SonarQube Community** across **39 real-world GitHub repositories** (3 repositories per language: *Vulnerable Security Benchmarks*, *Real-World Applications*, and *Production Frameworks/Libraries*).
|
|
383
449
|
|
|
384
|
-
|
|
450
|
+
---
|
|
385
451
|
|
|
386
|
-
###
|
|
452
|
+
### 1. Ground-Truth Monorepo Evaluation (`npm run evaluate`)
|
|
387
453
|
|
|
388
|
-
- **Total Ground-Truth Bugs**: 29
|
|
389
|
-
- **Recall (Detection Rate)**: **100.0%** (29/29 bugs caught)
|
|
390
|
-
- **Precision (False
|
|
454
|
+
- **Total Ground-Truth Bugs**: `29`
|
|
455
|
+
- **Recall (Detection Rate)**: **100.0%** (`29/29` bugs caught)
|
|
456
|
+
- **Precision (Zero False Positives)**: **100.0%** (`0` false alarms on safe equivalents)
|
|
391
457
|
- **F1 Score**: **100.0%**
|
|
392
458
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
|
396
|
-
|
|
397
|
-
| **
|
|
398
|
-
| **
|
|
399
|
-
| **
|
|
400
|
-
| **Java (Maven, standard)** | 3 | 3 | 0 | 0 | **100.0%** |
|
|
401
|
-
| **PHP (Laravel, Blade)** | 3 | 3 | 0 | 0 | **100.0%** |
|
|
459
|
+
| Language / Framework | Expected Bugs | Caught (TP) | Missed (FN) | False Alarms (FP) | Recall | Precision |
|
|
460
|
+
|----------------------|:-------------:|:-----------:|:-----------:|:-----------------:|:------:|:---------:|
|
|
461
|
+
| **JavaScript / TypeScript (Express, NestJS)** | 13 | 13 | 0 | 0 | **100.0%** | **100.0%** |
|
|
462
|
+
| **Python (Flask, Django)** | 7 | 7 | 0 | 0 | **100.0%** | **100.0%** |
|
|
463
|
+
| **Go (net/http)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
|
|
464
|
+
| **Java (Maven, Spring)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
|
|
465
|
+
| **PHP (Laravel, Blade)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
|
|
402
466
|
|
|
403
|
-
|
|
467
|
+
Run the ground-truth evaluation locally:
|
|
404
468
|
```bash
|
|
405
469
|
npm run evaluate
|
|
406
470
|
```
|
|
407
471
|
|
|
408
472
|
---
|
|
409
473
|
|
|
474
|
+
### 2. Global 39-Repository Benchmark: DeepScan vs. Semgrep, Trivy, Gitleaks & SonarQube (13 Languages)
|
|
475
|
+
|
|
476
|
+
Each of the **13 supported languages** is benchmarked across **3 repositories** (`39` repositories, `9,230` files total) covering deliberately vulnerable OWASP benchmarks, full-stack applications, and production frameworks.
|
|
477
|
+
|
|
478
|
+
#### Aggregated Results by Language (13 Languages × 3 Repositories = 39 Repos)
|
|
479
|
+
|
|
480
|
+
| Language (3 Repos / Lang) | Files Scanned | DeepScan Time | 🏆 DeepScan (`SAST / Sec / CVE`) | Semgrep Raw (`Real Code SAST* / Sec`) | Trivy (`CVE / Sec`) | Gitleaks (`Sec`) | SonarQube Community |
|
|
481
|
+
| :--- | ---: | ---: | :--- | :--- | :--- | :--- | :--- |
|
|
482
|
+
| **1. JavaScript** (`NodeGoat`, `dvna`, `express`) | 254 | **5.7s** | **`39` / `11` / `121`** | `86` (**`35` real**) / `4` | `93` / `1` | `3` | `17` Vuln on `NodeGoat` |
|
|
483
|
+
| **2. TypeScript** (`bulletproof`, `nestjs`, `zod`) | 1,007 | **40.3s** | **`4` / `0` / `918`** | `45` (**`3` real**) / `1` | `698` / `1` | `3` | `0` Vuln / `2` Hotspots |
|
|
484
|
+
| **3. Python** (`pygoat`, `vulpy`, `flask`) | 295 | **8.6s** | **`104` / `18` / `1,181`** | `225` (**`110` real**) / `2` | `583` / `4` | `17` | `59` Vuln on `pygoat` |
|
|
485
|
+
| **4. Java** (`WebGoat`, `VulnerableApp`, `petclinic`) | 1,099 | **15.7s** | **`113` / `25` / `190`** | `248` (**`119` real**) / `29` | `0` / `13` | `40` | ❌ **Failed** *(Requires `.class` build)* |
|
|
486
|
+
| **5. Go** (`go-test-bench`, `gin`, `echo`) | 351 | **10.7s** | **`26` / `2` / `58`** | `44` (**`28` real**) / `2` | `80` / `1` | `6` | `11` Vuln on `go-test-bench` |
|
|
487
|
+
| **6. PHP** (`DVWA`, `xvwa`, `Slim`) | 363 | **4.6s** | **`153` / `9` / `6`** | `90` (**`88` real**) / `0` | `1` / `0` | `1` | `78` Vuln on `DVWA` |
|
|
488
|
+
| **7. Ruby** (`railsgoat`, `sinatra`, `clearance`) | 458 | **8.0s** | **`41` / `4` / `384`** | `60` (**`45` real**) / `2` | `188` / `0` | `2` | `9` Vuln on `railsgoat` |
|
|
489
|
+
| **8. Rust** (`actix`, `axum`, `ripgrep`) | 763 | **21.4s** | **`7` / `15` / `719`** | `14` (**`0` in `.rs`**) / `13` | `6` / `7` | `16` | ❌ **Unsupported** |
|
|
490
|
+
| **9. C** (`hiredis`, `libyaml`, `mongoose`) | 1,110 | **83.6s** | **`16` / `41` / `0`** | `29` (**`0` in `.c`**) / `2` | `0` / `2` | `44` | ❌ **Paywalled** *(Developer Edition)* |
|
|
491
|
+
| **10. C++** (`fmt`, `spdlog`, `cpp-httplib`) | 317 | **22.8s** | **`8` / `0` / `0`** | `19` (**`14` real**) / `0` | `0` / `0` | `11` | ❌ **Paywalled** *(Developer Edition)* |
|
|
492
|
+
| **11. C#** (`eShopOnWeb`, `WebGoat.NET`, `Dapper`) | 601 | **6.4s** | **`42` / `3` / `14`** | `82` (**`28` real**) / `0` | `13` / `0` | `1` | ❌ **Failed** *(Requires MSBuild)* |
|
|
493
|
+
| **12. Kotlin** (`ktor-samples`, `koin`, `okhttp`) | 1,544 | **19.2s** | **`14` / `11` / `1`** | `26` (**`18` real**) / `1` | `78` / `1` | `22` | `0` Vuln / `4` Hotspots |
|
|
494
|
+
| **13. Swift** (`vapor`, `Alamofire`, `swift-crypto`) | 1,070 | **24.2s** | **`47` / `45` / `0`** | `347` (**`0` in `.swift`**) / `45` | `9` / `1` | `2,208`* | ❌ **Paywalled** *(Developer Edition)* |
|
|
495
|
+
| **TOTAL (39 Repos)** | **9,232** | **271.2s** | **`614` SAST / `184` Sec / `3,592` CVE** | `1,315` (**`~488` real**) / `99` Sec | `1,749` CVE / `30` Sec | `2,374`* Sec | **Only 7/13 Languages Supported** |
|
|
496
|
+
|
|
497
|
+
> \* **Note on Semgrep & Gitleaks Raw Counts**:
|
|
498
|
+
> - Bug-by-bug (`file:line`) inspection reveals that **~62% of Semgrep's raw alerts (`827 / 1,315`) are non-code noise or false positives**: `166` `django-no-csrf-token` alerts firing on static `.html` forms (including `107` in Java `WebGoat`, `4` in Rust `actix`, and `3` in Node.js `NodeGoat`), `346` duplicate GitHub Actions YAML alerts in `Alamofire`, `54` false SQLi alerts on `UPPER_SNAKE_CASE` constant table names (`+ USER_TB_NAME`) in `WebGoat.NET`, `53` CDN `<script>` `missing-integrity` alerts, and `63` regex alerts inside bundled vendor JS (`ace.js`, `moment.js`) or regex test suites (`zod`).
|
|
499
|
+
> - On `apple/swift-crypto`, Gitleaks flags `2,203` hex/base64 test vectors inside `Tests/` as secret leaks, whereas DeepScan and Semgrep report `38` and `37` PEM private keys respectively.
|
|
500
|
+
|
|
501
|
+
#### Key Benchmark Highlights
|
|
502
|
+
- **100% Zero False Positives on Clean Production Architectures**: Across **6 clean reference repositories** (`lujakob/nestjs-realworld-example-app`, `spring-projects/spring-petclinic`, `yaml/libyaml`, `gabime/spdlog`, `dotnet-architecture/eShopOnWeb`, and `Alamofire/Alamofire`), **DeepScan triggers `0` SAST false alarms (`0` findings)**.
|
|
503
|
+
- **Zero False Positives on Remediated `impossible.php` targets**: In `digininja/DVWA`, every vulnerability module includes `low.php`, `medium.php`, `high.php` (vulnerable) and `impossible.php` (securely patched with prepared statements and `intval()`). DeepScan catches **`123` real vulnerabilities** across `low`/`medium`/`high` while achieving **`0` false positives across all `impossible.php` files** (whereas Semgrep triggers 2 false positives on `impossible.php`).
|
|
504
|
+
- **2.05× More CVEs Detected than Trivy (`3,592` vs. `1,749`)**: DeepScan parses transitive dependency trees from `package-lock.json`, `yarn.lock`, `Gemfile.lock`, `Cargo.lock`, MSBuild `Directory.Packages.props` (with `$(Property)` variable substitution), and Gradle Version Catalogs (`gradle/libs.versions.toml`).
|
|
505
|
+
|
|
506
|
+
#### Detailed 39-Repository Breakdown
|
|
507
|
+
|
|
508
|
+
<details>
|
|
509
|
+
<summary><b>Click to expand all 39 repositories (13 Languages × 3 Tiers)</b></summary>
|
|
510
|
+
|
|
511
|
+
| # | Language | Repository | Tier | Files | Time | DeepScan (`SAST / Sec / CVE`) | Semgrep Raw (`Real / Sec`) | Trivy (`CVE / Sec`) | Gitleaks (`Sec`) |
|
|
512
|
+
| :-: | :--- | :--- | :--- | ---: | ---: | :--- | :--- | :--- | :--- |
|
|
513
|
+
| 1 | **JavaScript** | `OWASP/NodeGoat` | Vulnerable App | 44 | 4.0s | **`8` / `4` / `83`** | `23` (`7` real) / `4` | `93` / `1` | `3` |
|
|
514
|
+
| 2 | **JavaScript** | `appsecco/dvna` | Vulnerable App | 67 | 1.7s | **`21` / `1` / `36`** | `20` (`14` real) / `0` | `0` / `0` | `0` |
|
|
515
|
+
| 3 | **JavaScript** | `expressjs/express` | Production Lib | 143 | 2.6s | **`10` / `6` / `2`** | `43` (`14` real) / `0` | `0` / `0` | `0` |
|
|
516
|
+
| 4 | **TypeScript** | `alan2207/bulletproof-react` | Real-World App | 439 | 20.6s | **`3` / `0` / `762`** | `5` (`1` real) / `0` | `312` / `0` | `0` |
|
|
517
|
+
| 5 | **TypeScript** | `lujakob/nestjs-realworld-example-app` | Real-World App | 37 | 3.0s | **`0` / `0` / `127`** | `0` (`0` real) / `0` | `354` / `0` | `0` |
|
|
518
|
+
| 6 | **TypeScript** | `colinhacks/zod` | Production Lib | 531 | 16.7s | **`1` / `0` / `29`** | `40` (`2` real) / `1` | `32` / `1` | `3` |
|
|
519
|
+
| 7 | **Python** | `adeyosemanputra/pygoat` | Vulnerable App | 143 | 5.4s | **`56` / `15` / `1,125`** | `164` (`75` real) / `2` | `568` / `4` | `10` |
|
|
520
|
+
| 8 | **Python** | `fportantier/vulpy` | Vulnerable App | 64 | 0.5s | **`40` / `3` / `0`** | `45` (`29` real) / `0` | `0` / `0` | `1` |
|
|
521
|
+
| 9 | **Python** | `pallets/flask` | Production Lib | 88 | 2.8s | **`8` / `0` / `56`** | `16` (`5` real) / `0` | `15` / `0` | `6` |
|
|
522
|
+
| 10 | **Java** | `WebGoat/WebGoat` | Vulnerable App | 724 | 8.5s | **`54` / `17` / `169`** | `196` (`63` real) / `13` | `0` / `0` | `24` |
|
|
523
|
+
| 11 | **Java** | `SasanLabs/VulnerableApp` | Vulnerable App | 308 | 5.7s | **`59` / `8` / `0`** | `48` (`48` real) / `16` | `0` / `13` | `16` |
|
|
524
|
+
| 12 | **Java** | `spring-projects/spring-petclinic` | Real-World App | 67 | 1.5s | **`0` / `0` / `21`** | `4` (`1` real) / `0` | `0` / `0` | `0` |
|
|
525
|
+
| 13 | **Go** | `Contrast-Security-OSS/go-test-bench` | Vulnerable App | 131 | 2.2s | **`17` / `0` / `42`** | `21` (`21` real) / `0` | `64` / `0` | `0` |
|
|
526
|
+
| 14 | **Go** | `gin-gonic/gin` | Production Lib | 103 | 3.1s | **`6` / `1` / `8`** | `20` (`5` real) / `1` | `8` / `0` | `4` |
|
|
527
|
+
| 15 | **Go** | `labstack/echo` | Production Lib | 117 | 5.4s | **`3` / `1` / `8`** | `3` (`2` real) / `1` | `8` / `1` | `2` |
|
|
528
|
+
| 16 | **PHP** | `digininja/DVWA` | Vulnerable App | 181 | 1.9s | **`123` / `9` / `0`** | `71` (`69` real) / `0` | `1` / `0` | `1` |
|
|
529
|
+
| 17 | **PHP** | `s4n7h0/xvwa` | Vulnerable App | 56 | 0.5s | **`28` / `0` / `0`** | `19` (`18` real) / `0` | `0` / `0` | `0` |
|
|
530
|
+
| 18 | **PHP** | `slimphp/Slim` | Production Lib | 126 | 2.2s | **`2` / `0` / `6`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
|
|
531
|
+
| 19 | **Ruby** | `OWASP/railsgoat` | Vulnerable App | 166 | 3.1s | **`28` / `2` / `74`** | `41` (`31` real) / `1` | `116` / `0` | `1` |
|
|
532
|
+
| 20 | **Ruby** | `sinatra/sinatra` | Production Lib | 173 | 3.5s | **`12` / `0` / `258`** | `5` (`5` real) / `1` | `0` / `0` | `1` |
|
|
533
|
+
| 21 | **Ruby** | `thoughtbot/clearance` | Production Lib | 119 | 1.4s | **`1` / `2` / `52`** | `14` (`9` real) / `0` | `72` / `0` | `0` |
|
|
534
|
+
| 22 | **Rust** | `actix/examples` | Real-World App | 266 | 7.1s | **`2` / `7` / `76`** | `10` (`0` `.rs`) / `6` | `6` / `7` | `7` |
|
|
535
|
+
| 23 | **Rust** | `tokio-rs/axum` | Production Lib | 383 | 8.8s | **`1` / `8` / `642`** | `2` (`0` `.rs`) / `7` | `0` / `0` | `9` |
|
|
536
|
+
| 24 | **Rust** | `BurntSushi/ripgrep` | Production Lib | 114 | 5.5s | **`4` / `0` / `1`** | `2` (`0` `.rs`) / `0` | `0` / `0` | `0` |
|
|
537
|
+
| 25 | **C** | `redis/hiredis` | Production Lib | 53 | 1.9s | **`3` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
|
|
538
|
+
| 26 | **C** | `yaml/libyaml` | Production Lib | 24 | 1.4s | **`0` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
|
|
539
|
+
| 27 | **C** | `cesanta/mongoose` | Production Lib | 1,033 | 80.3s | **`13` / `41` / `0`** | `29` (`0` `.c`) / `2` | `0` / `2` | `44` |
|
|
540
|
+
| 28 | **C++** | `fmtlib/fmt` | Production Lib | 83 | 5.2s | **`1` / `0` / `0`** | `5` (`1` `.cc`) / `0` | `0` / `0` | `0` |
|
|
541
|
+
| 29 | **C++** | `gabime/spdlog` | Production Lib | 154 | 3.3s | **`0` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
|
|
542
|
+
| 30 | **C++** | `yhirose/cpp-httplib` | Production Lib | 80 | 14.3s | **`7` / `0` / `0`** | `14` (`13` real) / `0` | `0` / `0` | `11` |
|
|
543
|
+
| 31 | **C#** | `dotnet-architecture/eShopOnWeb` | Real-World App | 266 | 2.2s | **`0` / `2` / `5`** | `1` (`1` real) / `0` | `4` / `0` | `1` |
|
|
544
|
+
| 32 | **C#** | `jerryhoff/WebGoat.NET` | Vulnerable App | 166 | 1.2s | **`35` / `1` / `0`** | `70` (`16` real / `54` FP) / `0` | `0` / `0` | `0` |
|
|
545
|
+
| 33 | **C#** | `DapperLib/Dapper` | Production Lib | 169 | 3.0s | **`7` / `0` / `9`** | `11` (`11` real) / `0` | `9` / `0` | `0` |
|
|
546
|
+
| 34 | **Kotlin** | `ktorio/ktor-samples` | Real-World App | 275 | 2.3s | **`6` / `2` / `0`** | `3` (`3` real) / `0` | `0` / `0` | `1` |
|
|
547
|
+
| 35 | **Kotlin** | `InsertKoinIO/koin` | Production Lib | 569 | 5.2s | **`1` / `0` / `0`** | `3` (`0` `.kt`) / `0` | `0` / `0` | `0` |
|
|
548
|
+
| 36 | **Kotlin** | `square/okhttp` | Production Lib | 700 | 11.8s | **`7` / `9` / `1`** | `20` (`15` real) / `1` | `78` / `1` | `21` |
|
|
549
|
+
| 37 | **Swift** | `vapor/vapor` | Production Lib | 282 | 4.1s | **`9` / `7` / `0`** | `0` (`0` real) / `8` | `0` / `1` | `5` |
|
|
550
|
+
| 38 | **Swift** | `Alamofire/Alamofire` | Production Lib | 104 | 4.9s | **`0` / `0` / `0`** | `346` (`0` `.swift`) / `0` | `9` / `0` | `0` |
|
|
551
|
+
| 39 | **Swift** | `apple/swift-crypto` | Production Lib | 684 | 15.2s | **`38` / `38` / `0`** | `1` (`0` `.swift`) / `37` | `0` / `0` | `2,203` |
|
|
552
|
+
|
|
553
|
+
</details>
|
|
554
|
+
|
|
555
|
+
#### Running the 39-Repository Benchmark Suite (`npm run benchmark`)
|
|
556
|
+
|
|
557
|
+
```bash
|
|
558
|
+
# Run the full 39-repository benchmark across all 13 languages (auto-clones missing repos into .benchmark-repos/)
|
|
559
|
+
npm run benchmark
|
|
560
|
+
|
|
561
|
+
# Fast SAST + Secrets run (skip network OSV.dev CVE queries)
|
|
562
|
+
npm run benchmark -- --no-cve
|
|
563
|
+
|
|
564
|
+
# Filter by specific languages or repository IDs
|
|
565
|
+
npm run benchmark -- --lang=javascript,python,go,csharp
|
|
566
|
+
|
|
567
|
+
# Re-run live Docker containers (Semgrep, Trivy, Gitleaks) in 1-CPU throttled mode
|
|
568
|
+
npm run benchmark -- --with-docker
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
410
573
|
## 📚 Documentation
|
|
411
574
|
|
|
412
575
|
For detailed setup and operational instructions, see:
|
|
413
|
-
- [Administrator Guide](
|
|
576
|
+
- [Administrator Guide](./docs/admin-guide.md) — System configuration, automatic ruleset updates, CLI options reference, and rule distribution.
|
|
414
577
|
|
|
415
578
|
---
|
|
416
579
|
|
|
417
580
|
## 📄 License
|
|
418
581
|
|
|
419
|
-
|
|
582
|
+
Licensed under the [Apache License 2.0](./LICENSE) — Copyright © 2026 DeepScan Contributors.
|