deepscan-cli 1.0.0 → 1.2.0

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.
Files changed (46) hide show
  1. package/NOTICE +5 -0
  2. package/README.md +174 -59
  3. package/dist/bin/deepscan.js +189 -71
  4. package/dist/bin/deepscan.js.map +1 -1
  5. package/dist/{chunk-OSYJXVNF.js → chunk-KITQQYNW.js} +5071 -596
  6. package/dist/chunk-KITQQYNW.js.map +1 -0
  7. package/dist/index.d.ts +61 -5
  8. package/dist/index.js +13 -3
  9. package/package.json +23 -5
  10. package/rules/built-in/default-config.yml +28 -3
  11. package/rules/built-in/operations.yml +287 -0
  12. package/rules/built-in/security.yml +12 -6
  13. package/dist/chunk-OSYJXVNF.js.map +0 -1
  14. package/rules/built-in/converted-semgrep.yml +0 -37
  15. package/rules/built-in/semgrep-apex.yml +0 -336
  16. package/rules/built-in/semgrep-bash.yml +0 -362
  17. package/rules/built-in/semgrep-c.yml +0 -429
  18. package/rules/built-in/semgrep-clojure.yml +0 -166
  19. package/rules/built-in/semgrep-csharp.yml +0 -1260
  20. package/rules/built-in/semgrep-dart.yml +0 -21
  21. package/rules/built-in/semgrep-dockerfile.yml +0 -874
  22. package/rules/built-in/semgrep-elixir.yml +0 -146
  23. package/rules/built-in/semgrep-generic.yml +0 -2945
  24. package/rules/built-in/semgrep-go.yml +0 -2898
  25. package/rules/built-in/semgrep-hcl.yml +0 -8181
  26. package/rules/built-in/semgrep-html.yml +0 -94
  27. package/rules/built-in/semgrep-java.yml +0 -4219
  28. package/rules/built-in/semgrep-javascript.yml +0 -6243
  29. package/rules/built-in/semgrep-json.yml +0 -360
  30. package/rules/built-in/semgrep-kotlin.yml +0 -540
  31. package/rules/built-in/semgrep-lua.yml +0 -46
  32. package/rules/built-in/semgrep-ocaml.yml +0 -773
  33. package/rules/built-in/semgrep-php.yml +0 -1638
  34. package/rules/built-in/semgrep-python.yml +0 -11240
  35. package/rules/built-in/semgrep-regex.yml +0 -6444
  36. package/rules/built-in/semgrep-ruby.yml +0 -2687
  37. package/rules/built-in/semgrep-rust.yml +0 -278
  38. package/rules/built-in/semgrep-scala.yml +0 -807
  39. package/rules/built-in/semgrep-sh.yml +0 -46
  40. package/rules/built-in/semgrep-solidity.yml +0 -1046
  41. package/rules/built-in/semgrep-swift.yml +0 -200
  42. package/rules/built-in/semgrep-terraform.yml +0 -147
  43. package/rules/built-in/semgrep-typescript.yml +0 -6212
  44. package/rules/built-in/semgrep-xml.yml +0 -31
  45. package/rules/built-in/semgrep-yaml.yml +0 -2785
  46. package/rules/examples/custom-api-security.yml +0 -66
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ DeepScan (deepscan-cli)
2
+ Copyright 2026 Mai Đức Tuấn & DeepScan Contributors
3
+
4
+ This product includes software developed by the DeepScan project
5
+ (https://github.com/maiductuan/code-security-scanner).
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
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![npm version](https://img.shields.io/npm/v/deepscan-cli.svg)](https://www.npmjs.com/package/deepscan-cli)
9
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
9
10
  [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org)
10
11
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
11
12
  [![DevSecOps](https://img.shields.io/badge/Security-Shift--Left-blue)](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 (Static Analysis)
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
- ### 📊 Code Quality & Clean Code
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** — AST-powered semantic duplicate detection.
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 (Supply Chain Security)
35
- - **Universal Package Support** — npm, pip, Maven, Go modules, Cargo, Composer, RubyGems.
36
- - **OSV Database Integration** — Real-time vulnerability checking using Google's Open Source Vulnerabilities.
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
- # Scan specific path
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,quality,cve` | `deepscan scan -s security,cve` |
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` |
@@ -258,6 +276,7 @@ CLI → Pipeline → File Discovery → Language Detection
258
276
  ↓
259
277
  Scanner Engines (parallel)
260
278
  ├── Security Scanner (patterns, taint, context)
279
+ ├── Operations Scanner (OOM-kill, timeouts, leaks, N+1)
261
280
  ├── Quality Scanner (complexity, duplication, metrics)
262
281
  └── CVE Scanner (dependency parsing, OSV query)
263
282
  ↓
@@ -270,21 +289,20 @@ CLI → Pipeline → File Discovery → Language Detection
270
289
 
271
290
  ---
272
291
 
273
- ## 📊 Comparison
274
-
275
- | Feature | DeepScan | SonarQube | Semgrep | Trivy |
276
- |---------|----------|-----------|---------|-------|
277
- | SAST | ✅ | ✅ | ✅ | ❌ |
278
- | SCA/CVE | ✅ | ✅ | ❌ | ✅ |
279
- | Secrets | ✅ | ✅ | ✅ | ✅ |
280
- | Context-Aware | ✅ | ❌ | ❌ | ❌ |
281
- | Taint Analysis | ✅ | ✅ | ✅ | ❌ |
282
- | AI Validation | ✅ | ❌ | ✅ | ❌ |
283
- | Zero Infrastructure | ✅ | ❌ | ✅ | ✅ |
284
- | Custom Rules (YAML) | ✅ | ❌ | ✅ | ❌ |
285
- | HTML Report | ✅ | ✅ | ✅ | ✅ |
286
- | SARIF Output | ✅ | ✅ | ✅ | ✅ |
287
- | Free & Open Source | ✅ | Partial | Partial | ✅ |
292
+ ## 📊 Feature Comparison
293
+
294
+ | Feature | DeepScan | SonarQube Community | Semgrep OSS | Trivy | Gitleaks |
295
+ |---------|:--------:|:-------------------:|:-----------:|:-----:|:--------:|
296
+ | **SAST (13 Languages)** | ✅ (13/13) | ⚠️ (7/13 — C/C++/Swift Paywalled, Rust Unsupported, Java/C# require build) | ✅ | ❌ | ❌ |
297
+ | **SCA / CVE (Transitive Lockfiles, NuGet, Gradle TOML)** | ✅ | ❌ | ❌ | ✅ | ❌ |
298
+ | **Secrets & Standalone Cert/Config (`.pem`, `.key`, `.env`, `.conf`)** | ✅ | ⚠️ Partial | ✅ | ✅ | ✅ |
299
+ | **AST & Sanitizer Context-Aware FP Filtering** | ✅ | ⚠️ Partial | ⚠️ Partial | ❌ | ❌ |
300
+ | **Inter-Procedural Taint Tracking** | ✅ | ❌ (Paid Edition) | ⚠️ (Pro Engine) | ❌ | ❌ |
301
+ | **Code Quality, Complexity & Duplication** | ✅ | ✅ | ❌ | ❌ | ❌ |
302
+ | **AI-Assisted Validation & Auto-Remediation** | ✅ | ❌ | ⚠️ (Cloud Paid) | ❌ | ❌ |
303
+ | **Zero Infrastructure (Single CLI)** | ✅ | ❌ (Requires Server + DB) | ✅ | ✅ | ✅ |
304
+ | **Custom Rules (YAML) & SARIF / HTML Reports** | ✅ | ❌ | ✅ | ✅ | ✅ |
305
+ | **100% Free & Open Source** | ✅ | Partial | Partial | ✅ | ✅ |
288
306
 
289
307
  ---
290
308
 
@@ -360,60 +378,157 @@ npm run lint
360
378
  ```
361
379
 
362
380
  ### Rule & Script Development
363
- - To test converting a single Semgrep rule file:
381
+ - 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:
382
+ ```bash
383
+ npm run rules:update
384
+ ```
385
+ - Optional local helper for converting your own custom YAML rules into DeepScan custom rule format:
386
+ ```bash
387
+ npx tsx scripts/convert-rules.ts --input tests/fixtures/semgrep-sample.yml --output ./my-rules/converted.yml
388
+ ```
389
+ - Run the test suite:
364
390
  ```bash
365
- npx tsx scripts/convert-rules.ts --input tests/fixtures/semgrep-sample.yml --output rules/built-in/converted-semgrep.yml
391
+ npm run test
366
392
  ```
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
393
 
378
394
  ---
379
395
 
380
396
  ## 📊 Benchmark & Accuracy Results
381
397
 
382
- To verify DeepScan's detection capability, we maintain a realistic multi-language monorepo benchmark in the `examples/` directory. It includes vulnerable controllers, web views, dynamic routing, and dependency manifests alongside their secure counterparts for **Node/Express/NestJS**, **Python/Flask/Django**, **Go/net/http**, and **PHP/Laravel**.
398
+ We validate DeepScan using a **two-tier evaluation methodology**:
399
+ 1. **Ground-Truth Monorepo Evaluation (`examples/`)**: Measures exact **Recall** and **Precision** against paired vulnerable and remediated ("safe") implementations.
400
+ 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
401
 
384
- Our automated evaluation framework measures **Recall** (detection coverage of ground-truth bugs) and **Precision** (avoidance of false alarms on clean code).
402
+ ---
385
403
 
386
- ### Latest Benchmark Results (v1.0)
404
+ ### 1. Ground-Truth Monorepo Evaluation (`npm run evaluate`)
387
405
 
388
- - **Total Ground-Truth Bugs**: 29
389
- - **Recall (Detection Rate)**: **100.0%** (29/29 bugs caught)
390
- - **Precision (False Positive Rate)**: **100.0%** (0 false alarms triggered)
406
+ - **Total Ground-Truth Bugs**: `29`
407
+ - **Recall (Detection Rate)**: **100.0%** (`29/29` bugs caught)
408
+ - **Precision (Zero False Positives)**: **100.0%** (`0` false alarms on safe equivalents)
391
409
  - **F1 Score**: **100.0%**
392
410
 
393
- #### Language Breakdown
394
-
395
- | Language / Framework | Expected Bugs | Caught (TP) | Missed (FN) | False Alarms (FP) | Accuracy (Recall) |
396
- |----------------------|---------------|-------------|-------------|-------------------|-------------------|
397
- | **JavaScript / TypeScript (Express, NestJS)** | 13 | 13 | 0 | 0 | **100.0%** |
398
- | **Python (Flask, Django)** | 7 | 7 | 0 | 0 | **100.0%** |
399
- | **Go (net/http)** | 3 | 3 | 0 | 0 | **100.0%** |
400
- | **Java (Maven, standard)** | 3 | 3 | 0 | 0 | **100.0%** |
401
- | **PHP (Laravel, Blade)** | 3 | 3 | 0 | 0 | **100.0%** |
411
+ | Language / Framework | Expected Bugs | Caught (TP) | Missed (FN) | False Alarms (FP) | Recall | Precision |
412
+ |----------------------|:-------------:|:-----------:|:-----------:|:-----------------:|:------:|:---------:|
413
+ | **JavaScript / TypeScript (Express, NestJS)** | 13 | 13 | 0 | 0 | **100.0%** | **100.0%** |
414
+ | **Python (Flask, Django)** | 7 | 7 | 0 | 0 | **100.0%** | **100.0%** |
415
+ | **Go (net/http)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
416
+ | **Java (Maven, Spring)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
417
+ | **PHP (Laravel, Blade)** | 3 | 3 | 0 | 0 | **100.0%** | **100.0%** |
402
418
 
403
- To run the accuracy evaluation script and generate the interactive [evaluation-report.html](file:///d:/code/code-scan-security/evaluation-report.html) dashboard:
419
+ Run the ground-truth evaluation locally:
404
420
  ```bash
405
421
  npm run evaluate
406
422
  ```
407
423
 
408
424
  ---
409
425
 
426
+ ### 2. Global 39-Repository Benchmark: DeepScan vs. Semgrep, Trivy, Gitleaks & SonarQube (13 Languages)
427
+
428
+ 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.
429
+
430
+ #### Aggregated Results by Language (13 Languages × 3 Repositories = 39 Repos)
431
+
432
+ | 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 |
433
+ | :--- | ---: | ---: | :--- | :--- | :--- | :--- | :--- |
434
+ | **1. JavaScript** (`NodeGoat`, `dvna`, `express`) | 254 | **5.7s** | **`39` / `11` / `121`** | `86` (**`35` real**) / `4` | `93` / `1` | `3` | `17` Vuln on `NodeGoat` |
435
+ | **2. TypeScript** (`bulletproof`, `nestjs`, `zod`) | 1,007 | **40.3s** | **`4` / `0` / `918`** | `45` (**`3` real**) / `1` | `698` / `1` | `3` | `0` Vuln / `2` Hotspots |
436
+ | **3. Python** (`pygoat`, `vulpy`, `flask`) | 295 | **8.6s** | **`104` / `18` / `1,181`** | `225` (**`110` real**) / `2` | `583` / `4` | `17` | `59` Vuln on `pygoat` |
437
+ | **4. Java** (`WebGoat`, `VulnerableApp`, `petclinic`) | 1,099 | **15.7s** | **`113` / `25` / `190`** | `248` (**`119` real**) / `29` | `0` / `13` | `40` | ❌ **Failed** *(Requires `.class` build)* |
438
+ | **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` |
439
+ | **6. PHP** (`DVWA`, `xvwa`, `Slim`) | 363 | **4.6s** | **`153` / `9` / `6`** | `90` (**`88` real**) / `0` | `1` / `0` | `1` | `78` Vuln on `DVWA` |
440
+ | **7. Ruby** (`railsgoat`, `sinatra`, `clearance`) | 458 | **8.0s** | **`41` / `4` / `384`** | `60` (**`45` real**) / `2` | `188` / `0` | `2` | `9` Vuln on `railsgoat` |
441
+ | **8. Rust** (`actix`, `axum`, `ripgrep`) | 763 | **21.4s** | **`7` / `15` / `719`** | `14` (**`0` in `.rs`**) / `13` | `6` / `7` | `16` | ❌ **Unsupported** |
442
+ | **9. C** (`hiredis`, `libyaml`, `mongoose`) | 1,110 | **83.6s** | **`16` / `41` / `0`** | `29` (**`0` in `.c`**) / `2` | `0` / `2` | `44` | ❌ **Paywalled** *(Developer Edition)* |
443
+ | **10. C++** (`fmt`, `spdlog`, `cpp-httplib`) | 317 | **22.8s** | **`8` / `0` / `0`** | `19` (**`14` real**) / `0` | `0` / `0` | `11` | ❌ **Paywalled** *(Developer Edition)* |
444
+ | **11. C#** (`eShopOnWeb`, `WebGoat.NET`, `Dapper`) | 601 | **6.4s** | **`42` / `3` / `14`** | `82` (**`28` real**) / `0` | `13` / `0` | `1` | ❌ **Failed** *(Requires MSBuild)* |
445
+ | **12. Kotlin** (`ktor-samples`, `koin`, `okhttp`) | 1,544 | **19.2s** | **`14` / `11` / `1`** | `26` (**`18` real**) / `1` | `78` / `1` | `22` | `0` Vuln / `4` Hotspots |
446
+ | **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)* |
447
+ | **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** |
448
+
449
+ > \* **Note on Semgrep & Gitleaks Raw Counts**:
450
+ > - 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`).
451
+ > - 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.
452
+
453
+ #### Key Benchmark Highlights
454
+ - **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)**.
455
+ - **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`).
456
+ - **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`).
457
+
458
+ #### Detailed 39-Repository Breakdown
459
+
460
+ <details>
461
+ <summary><b>Click to expand all 39 repositories (13 Languages × 3 Tiers)</b></summary>
462
+
463
+ | # | Language | Repository | Tier | Files | Time | DeepScan (`SAST / Sec / CVE`) | Semgrep Raw (`Real / Sec`) | Trivy (`CVE / Sec`) | Gitleaks (`Sec`) |
464
+ | :-: | :--- | :--- | :--- | ---: | ---: | :--- | :--- | :--- | :--- |
465
+ | 1 | **JavaScript** | `OWASP/NodeGoat` | Vulnerable App | 44 | 4.0s | **`8` / `4` / `83`** | `23` (`7` real) / `4` | `93` / `1` | `3` |
466
+ | 2 | **JavaScript** | `appsecco/dvna` | Vulnerable App | 67 | 1.7s | **`21` / `1` / `36`** | `20` (`14` real) / `0` | `0` / `0` | `0` |
467
+ | 3 | **JavaScript** | `expressjs/express` | Production Lib | 143 | 2.6s | **`10` / `6` / `2`** | `43` (`14` real) / `0` | `0` / `0` | `0` |
468
+ | 4 | **TypeScript** | `alan2207/bulletproof-react` | Real-World App | 439 | 20.6s | **`3` / `0` / `762`** | `5` (`1` real) / `0` | `312` / `0` | `0` |
469
+ | 5 | **TypeScript** | `lujakob/nestjs-realworld-example-app` | Real-World App | 37 | 3.0s | **`0` / `0` / `127`** | `0` (`0` real) / `0` | `354` / `0` | `0` |
470
+ | 6 | **TypeScript** | `colinhacks/zod` | Production Lib | 531 | 16.7s | **`1` / `0` / `29`** | `40` (`2` real) / `1` | `32` / `1` | `3` |
471
+ | 7 | **Python** | `adeyosemanputra/pygoat` | Vulnerable App | 143 | 5.4s | **`56` / `15` / `1,125`** | `164` (`75` real) / `2` | `568` / `4` | `10` |
472
+ | 8 | **Python** | `fportantier/vulpy` | Vulnerable App | 64 | 0.5s | **`40` / `3` / `0`** | `45` (`29` real) / `0` | `0` / `0` | `1` |
473
+ | 9 | **Python** | `pallets/flask` | Production Lib | 88 | 2.8s | **`8` / `0` / `56`** | `16` (`5` real) / `0` | `15` / `0` | `6` |
474
+ | 10 | **Java** | `WebGoat/WebGoat` | Vulnerable App | 724 | 8.5s | **`54` / `17` / `169`** | `196` (`63` real) / `13` | `0` / `0` | `24` |
475
+ | 11 | **Java** | `SasanLabs/VulnerableApp` | Vulnerable App | 308 | 5.7s | **`59` / `8` / `0`** | `48` (`48` real) / `16` | `0` / `13` | `16` |
476
+ | 12 | **Java** | `spring-projects/spring-petclinic` | Real-World App | 67 | 1.5s | **`0` / `0` / `21`** | `4` (`1` real) / `0` | `0` / `0` | `0` |
477
+ | 13 | **Go** | `Contrast-Security-OSS/go-test-bench` | Vulnerable App | 131 | 2.2s | **`17` / `0` / `42`** | `21` (`21` real) / `0` | `64` / `0` | `0` |
478
+ | 14 | **Go** | `gin-gonic/gin` | Production Lib | 103 | 3.1s | **`6` / `1` / `8`** | `20` (`5` real) / `1` | `8` / `0` | `4` |
479
+ | 15 | **Go** | `labstack/echo` | Production Lib | 117 | 5.4s | **`3` / `1` / `8`** | `3` (`2` real) / `1` | `8` / `1` | `2` |
480
+ | 16 | **PHP** | `digininja/DVWA` | Vulnerable App | 181 | 1.9s | **`123` / `9` / `0`** | `71` (`69` real) / `0` | `1` / `0` | `1` |
481
+ | 17 | **PHP** | `s4n7h0/xvwa` | Vulnerable App | 56 | 0.5s | **`28` / `0` / `0`** | `19` (`18` real) / `0` | `0` / `0` | `0` |
482
+ | 18 | **PHP** | `slimphp/Slim` | Production Lib | 126 | 2.2s | **`2` / `0` / `6`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
483
+ | 19 | **Ruby** | `OWASP/railsgoat` | Vulnerable App | 166 | 3.1s | **`28` / `2` / `74`** | `41` (`31` real) / `1` | `116` / `0` | `1` |
484
+ | 20 | **Ruby** | `sinatra/sinatra` | Production Lib | 173 | 3.5s | **`12` / `0` / `258`** | `5` (`5` real) / `1` | `0` / `0` | `1` |
485
+ | 21 | **Ruby** | `thoughtbot/clearance` | Production Lib | 119 | 1.4s | **`1` / `2` / `52`** | `14` (`9` real) / `0` | `72` / `0` | `0` |
486
+ | 22 | **Rust** | `actix/examples` | Real-World App | 266 | 7.1s | **`2` / `7` / `76`** | `10` (`0` `.rs`) / `6` | `6` / `7` | `7` |
487
+ | 23 | **Rust** | `tokio-rs/axum` | Production Lib | 383 | 8.8s | **`1` / `8` / `642`** | `2` (`0` `.rs`) / `7` | `0` / `0` | `9` |
488
+ | 24 | **Rust** | `BurntSushi/ripgrep` | Production Lib | 114 | 5.5s | **`4` / `0` / `1`** | `2` (`0` `.rs`) / `0` | `0` / `0` | `0` |
489
+ | 25 | **C** | `redis/hiredis` | Production Lib | 53 | 1.9s | **`3` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
490
+ | 26 | **C** | `yaml/libyaml` | Production Lib | 24 | 1.4s | **`0` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
491
+ | 27 | **C** | `cesanta/mongoose` | Production Lib | 1,033 | 80.3s | **`13` / `41` / `0`** | `29` (`0` `.c`) / `2` | `0` / `2` | `44` |
492
+ | 28 | **C++** | `fmtlib/fmt` | Production Lib | 83 | 5.2s | **`1` / `0` / `0`** | `5` (`1` `.cc`) / `0` | `0` / `0` | `0` |
493
+ | 29 | **C++** | `gabime/spdlog` | Production Lib | 154 | 3.3s | **`0` / `0` / `0`** | `0` (`0` real) / `0` | `0` / `0` | `0` |
494
+ | 30 | **C++** | `yhirose/cpp-httplib` | Production Lib | 80 | 14.3s | **`7` / `0` / `0`** | `14` (`13` real) / `0` | `0` / `0` | `11` |
495
+ | 31 | **C#** | `dotnet-architecture/eShopOnWeb` | Real-World App | 266 | 2.2s | **`0` / `2` / `5`** | `1` (`1` real) / `0` | `4` / `0` | `1` |
496
+ | 32 | **C#** | `jerryhoff/WebGoat.NET` | Vulnerable App | 166 | 1.2s | **`35` / `1` / `0`** | `70` (`16` real / `54` FP) / `0` | `0` / `0` | `0` |
497
+ | 33 | **C#** | `DapperLib/Dapper` | Production Lib | 169 | 3.0s | **`7` / `0` / `9`** | `11` (`11` real) / `0` | `9` / `0` | `0` |
498
+ | 34 | **Kotlin** | `ktorio/ktor-samples` | Real-World App | 275 | 2.3s | **`6` / `2` / `0`** | `3` (`3` real) / `0` | `0` / `0` | `1` |
499
+ | 35 | **Kotlin** | `InsertKoinIO/koin` | Production Lib | 569 | 5.2s | **`1` / `0` / `0`** | `3` (`0` `.kt`) / `0` | `0` / `0` | `0` |
500
+ | 36 | **Kotlin** | `square/okhttp` | Production Lib | 700 | 11.8s | **`7` / `9` / `1`** | `20` (`15` real) / `1` | `78` / `1` | `21` |
501
+ | 37 | **Swift** | `vapor/vapor` | Production Lib | 282 | 4.1s | **`9` / `7` / `0`** | `0` (`0` real) / `8` | `0` / `1` | `5` |
502
+ | 38 | **Swift** | `Alamofire/Alamofire` | Production Lib | 104 | 4.9s | **`0` / `0` / `0`** | `346` (`0` `.swift`) / `0` | `9` / `0` | `0` |
503
+ | 39 | **Swift** | `apple/swift-crypto` | Production Lib | 684 | 15.2s | **`38` / `38` / `0`** | `1` (`0` `.swift`) / `37` | `0` / `0` | `2,203` |
504
+
505
+ </details>
506
+
507
+ #### Running the 39-Repository Benchmark Suite (`npm run benchmark`)
508
+
509
+ ```bash
510
+ # Run the full 39-repository benchmark across all 13 languages (auto-clones missing repos into .benchmark-repos/)
511
+ npm run benchmark
512
+
513
+ # Fast SAST + Secrets run (skip network OSV.dev CVE queries)
514
+ npm run benchmark -- --no-cve
515
+
516
+ # Filter by specific languages or repository IDs
517
+ npm run benchmark -- --lang=javascript,python,go,csharp
518
+
519
+ # Re-run live Docker containers (Semgrep, Trivy, Gitleaks) in 1-CPU throttled mode
520
+ npm run benchmark -- --with-docker
521
+ ```
522
+
523
+ ---
524
+
410
525
  ## 📚 Documentation
411
526
 
412
527
  For detailed setup and operational instructions, see:
413
- - [Administrator Guide](file:///d:/code/code-scan-security/docs/admin-guide.md) — System configuration, automatic ruleset updates, CLI options reference, and rule distribution.
528
+ - [Administrator Guide](./docs/admin-guide.md) — System configuration, automatic ruleset updates, CLI options reference, and rule distribution.
414
529
 
415
530
  ---
416
531
 
417
532
  ## 📄 License
418
533
 
419
- MIT © DeepScan Contributors
534
+ Licensed under the [Apache License 2.0](./LICENSE) — Copyright © 2026 DeepScan Contributors.