Repository navigation
Releases
DevGuard v1.3.0 — AST Virtual Folding & Resilient Evasion Defense Engine
What's Changed in DevGuard v1.3.0
DevGuard v1.3.0 introduces the Lexical Constant Folding Engine (Pass-V & SpanMap), Non-Scoring Dynamic Import Visibility (DG004-DYN-01/02), and hardened Anti-Evasion Detectors (DG008-EV-01 & DG005-EV-01), while maintaining a strict Zero-Runtime Dependency policy ("dependencies": {}).
🚀 Highlights
Lexical Constant Folding Engine & Virtual View (Pass-V & SpanMap)
-
Deterministic Virtual Folding (
FOLD-03→FOLD-01→FOLD-02→FOLD-04): Synthesizes virtual source codeVto defeat lexical evasion—including string concatenation ("ch" + "ild_process"), no-interpolation backtick templates, string array.join(), and safe bracket-to-dot member access (obj["member"]). -
Strict
$O(\log N)$ Coordinate Mapping (SpanMap): Binary-search interval mapping accurately projects folded virtual[line, endLine]spans back to original source positionsOfor GitHub PR inline review suggestions, inline suppressions, and SARIF reporting ([via-fold]). -
Multi-Tiered DoS Guards & Priority Budgeting: Enforces hard deterministic caps (
MAX_FOLD_DEPTH = 4,MAX_FOLD_OPERANDS = 64,MAX_FOLDED_LENGTH = 4096,MAX_FOLD_EDITS = 2000,MAX_BACKSCAN = 256) with priority scheduling for security-sensitive sinks and deduplicated SARIFfold_limit_exceeded(level: "note") notifications.
Non-Scoring Dynamic Import & Require Visibility (DG004-DYN-01 & DG004-DYN-02)
- Runtime Specifier Visibility: Detects non-literal
import(expr)andrequire(expr)calls (with localrequireshadow guard) to surface dynamic dependency loading without penalizing repository health scores (severity: "warning",properties.scoring: false). - Linear-Time Allowlist Matching: Evaluates base-branch
.devguard.jsonpath rules using linear-time glob matching (matchLinearGlob) immune to ReDoS backtracking.
Anti-Evasion Detectors (DG008-EV-01 & DG005-EV-01)
DG008-EV-01: Detects unbounded asynchronousdo { ... } while (true | 1)loops with scope-aware nestedbreak/returnstripping and retry-counter mutation validation.DG005-EV-01: Detects swallowed Promise.catch(() => {})rejections across critical transaction, authentication, and database receiver chains while respecting immediate cleanup calls (unlink,rmSync,close,JSON.parse).
Precision & Usability Enhancements
- False Positive Hardening: Eliminated false positives on benign
RegExp.prototype.exec(), DOM helpers (page.$eval()), and JS/TS method declarations (async exec() {}), and expandedDG004coverage for 2-argumentimport()and multi-line folded imports. - Expanded File Discovery & Coverage Telemetry: Added automatic support for
.mjs,.cjs,.mts, and.cts, explicitpartialcoverage reporting for.py, andN/Ascore semantics when0code files are analyzed. - CLI & CI Reliability: Added
--version/-vCLI flag support and deterministic in-process test execution across Linux (Node 22) and Windows.
📊 Benchmark & Validation Metrics
- Corpus Benchmark: Evaluated across 129 curated test cases (
48 TP,63 TNwith0corpus false positives,18 EVASIONvectors, and6newly solved evasions). - Pass-O vs Pass-O+V Performance Gate:
+8.21%median overhead across the full 129-case corpus (+1.44%on non-fold baseline cases), well within the<= +25%release gate. - External OSS Validation: Audited 10 public JS/TS repositories (
4,318analyzed files) offline with0crashes and0analysis failures. - Test Suite: 82/82 passing scenarios (
Corpus Benchmark+Tests 1–81integration suite). - Runtime Dependencies:
0("dependencies": {}).
DevGuard v1.2.1 — Adversarial Audit Hardening & Zero-Install CI Gate
🛡️ DevGuard v1.2.1 — Hardened Zero-Dependency Security Gatekeeper
Verified on ubuntu-latest (Workflow Run 43845288862, 35/35 automated tests passing).
🛡️ DevGuard v1.2.1 — Hardened Zero-Dependency Security GatekeeperVerified on ubuntu-latest (Workflow Run 43845288862, 35/35 automated tests passing). 📌 Immutable Supply-Chain PinningPin by full commit SHA: 09bae24 # v1.2.1🚀 Key Security & Architectural HardeningTrue Zero-Install & 100% Zero-Dependency Runtime: Executes natively on Node.js 22 via src/loader.mjs (node:module registerHooks + --experimental-strip-types) with "dependencies": {} in package.json. Fail-Closed Pre-LLM Secret Redaction & Residual Entropy Gate: Layout-preserving UTF-16 redaction (redactSecretsPreservingLayout), expanded sensitive filename blocklist (.env*, *.pem, *.key, *.p12, *.pfx, .npmrc, .netrc, *.tfvars, credentials.json), and an independent Shannon entropy gate (>= 4.2 bits/char). Non-Bypassable Suppression Policy & Base-Branch Allowlist: Lexer-only comment parsing (analyzeLexicalStructure), multi-word reason enforcement, DG004/DG006 restricted strictly to base-branch .devguard.json (origin/${GITHUB_BASE_REF}), and hard-blocked inline suppressions for DG001, DG002, DG003, DG004, DG005 (error), DG006, and DG007. Fork PR Safety, Anti-Pwn-Request Guard, & SARIF v2.1.0 Metadata: Upfront fork detection (detectPrEnvironment), runtime pull_request_target rejection, 1MB ReDoS file-size guard, x-goog-api-key header authentication, PR markdown sanitization, and per-rule GitHub Code Scanning security-severity ratings (5.0–9.5). 61-Case Labeled Benchmark Corpus: Honest TP/TN/Evasion accounting via npm run corpus:report (24/24 TP, 0/19 FP on TN corpus).
DevGuard v1.2.0 — The AI-Slop & Vibe-Coding Security Gatekeeper
🛡️ What's New in DevGuard v1.2.0
DevGuard v1.2.0 evolves from a hybrid PR reviewer into a Zero-Dependency AI-Slop & Vibe-Coding Security Gatekeeper with one-click remediation.
🚀 Key Highlights
- 8 Deterministic Zero-Dependency Security Rules (
DG001–DG008):DG001–DG003: Command/Code Injection, Path Traversal, & Unsafe Execution Sinks.DG004: Hallucinated & Typosquatted Package Imports (Slopsquatting Guard).DG005: Swallowed Exceptions in Critical Auth, Payment, & Database Flows.DG006: Non-Atomic Balance/Inventory Mutations (TOCTOU Race Conditions).DG007: Hardcoded AI, Cloud, & Payment API Keys (Provider Prefix + Shannon Entropy).DG008: Unbounded Async Retry Loops & Missingfetch()Timeouts.
- One-Click Inline PR Suggested Changes: Posts deduplicated line-level review annotations with commitable
suggestionblocks directly inside the Pull Request Files changed tab. - Hardened Modular Architecture (
src/rules/): Zero-dependency core achieving an average 96/100 self-audit score and verified by 14/14 end-to-end integration tests.
DevGuard v1.1.0 — Automated PR Sticky Comments & SARIF v2.1.0 Code Scanning
What's New in v1.1.0
- 💬 Zero-Dependency Sticky PR Commenter (
src/githubCommenter.ts): Automatically posts and updates a single consolidated security audit table, fatal flaw breakdown, and Defense-in-Depth notes directly on Pull Requests without comment spamming. - 🛡️ OASIS SARIF v2.1.0 Export (
src/sarifGenerator.ts): Native integration with GitHub Code Scanning (github/codeql-action/upload-sarif@v3). Maps findings to rule IDsDG001(Critical Security/Logic Flaw),DG002(Defense-in-Depth Hardening), andDG003(Threshold Gate Violation) with automatic line-number anchoring. - ⚙️ Resilient CI/CD Execution: Emits valid empty SARIF runs when no target files are changed and guarantees report output prior to non-zero exit codes so
if: always()SARIF uploads always succeed.
DevGuard v1.0.0 — Zero-Leniency Hybrid Adversarial Code Auditor
DevGuard v1.0.0: Initial Release
Initial public release of DevGuard, an adversarial code review and security gatekeeper powered by Google Gemini 3.8 Flash and deterministic AST heuristics.
🛡️ Key Features
- Dual-Layer Evaluation Engine:
- Layer 1 (Offline / Deterministic): AST & heuristic analysis detecting dangerous sinks, missing type checks, and TOCTOU vulnerabilities with zero API dependency.
- Layer 2 (Semantic Reasoning): Adversarial analysis via Gemini 3.8 Flash evaluating untrusted snippets inside
<code_to_review>data isolation tags.
- Zero-Gimmick Scoring: Eliminates hardcoded bypasses and applies realistic scoring (93–95/100 caps) with actionable Defense-in-Depth architectural recommendations.
- Hardened Vulnerability Presets:
- Banking Ledger (Python): Strict type guards (
type(x) is int) and atomic conditional queries. - JWT Auth & IDOR (TypeScript): Explicit interface typing and pinned
HS256algorithms. - System Ping Tool (Python): Subprocess timeout enforcement and private/loopback SSRF blocking.
- File Server (Node.js):
path.relativecontainment validation and realpath checks. - Checkout Cart (JavaScript): Safe integer range enforcement and server-authoritative catalog locking.
- Banking Ledger (Python): Strict type guards (
- Empirical SQLite Test Harness: Validated 6/6 deterministic ACID transaction scenarios against concurrent race conditions and tampering attempts.
🚀 Usage as a GitHub Action
Add DevGuard to your CI workflow (.github/workflows/devguard.yml):
name: DevGuard Security Audit
on:
pull_request:
branches: [ main ]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: OkyWoww/DevGuard@v1.0.0
with:
gemini_api_key: ${{ secrets.GEMINI_API_KEY }} # Optional: falls back to 100% offline Layer 1 if omitted
min_score: '85'branding: