Skip to content

Releases

DevGuard v1.3.0 — AST Virtual Folding & Resilient Evasion Defense Engine

Choose a tag to compare

@OkyWoww OkyWoww released this 19 Nov 06:43

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 code V to 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 positions O for 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 SARIF fold_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) and require(expr) calls (with local require shadow guard) to surface dynamic dependency loading without penalizing repository health scores (severity: "warning", properties.scoring: false).
  • Linear-Time Allowlist Matching: Evaluates base-branch .devguard.json path 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 asynchronous do { ... } while (true | 1) loops with scope-aware nested break/return stripping 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 expanded DG004 coverage for 2-argument import() and multi-line folded imports.
  • Expanded File Discovery & Coverage Telemetry: Added automatic support for .mjs, .cjs, .mts, and .cts, explicit partial coverage reporting for .py, and N/A score semantics when 0 code files are analyzed.
  • CLI & CI Reliability: Added --version / -v CLI 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 TN with 0 corpus false positives, 18 EVASION vectors, and 6 newly 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,318 analyzed files) offline with 0 crashes and 0 analysis failures.
  • Test Suite: 82/82 passing scenarios (Corpus Benchmark + Tests 1–81 integration suite).
  • Runtime Dependencies: 0 ("dependencies": {}).

DevGuard v1.2.1 — Adversarial Audit Hardening & Zero-Install CI Gate

Choose a tag to compare

@OkyWoww OkyWoww released this 16 Nov 10:17
e67c869

🛡️ 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

Choose a tag to compare

@OkyWoww OkyWoww released this 14 Nov 08:43

🛡️ 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 & Missing fetch() Timeouts.
  • One-Click Inline PR Suggested Changes: Posts deduplicated line-level review annotations with commitable suggestion blocks 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

Choose a tag to compare

@OkyWoww OkyWoww released this 07 Nov 06:42

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 IDs DG001 (Critical Security/Logic Flaw), DG002 (Defense-in-Depth Hardening), and DG003 (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

Choose a tag to compare

@OkyWoww OkyWoww released this 06 Nov 02:04

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 HS256 algorithms.
    • System Ping Tool (Python): Subprocess timeout enforcement and private/loopback SSRF blocking.
    • File Server (Node.js): path.relative containment validation and realpath checks.
    • Checkout Cart (JavaScript): Safe integer range enforcement and server-authoritative catalog locking.
  • 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: