
AI AppSec Auditor & Immutable Ledger
Offensive & defensive security auditor (Red Team / Blue Team) and Immutable Ledger (SHA-256 Hash Chain) architect for AI-generated apps (Vibe Coding). Scans 20 OWASP/Vibe Coding attack vectors, simulates real exploits, and delivers Zero-Mock production patches with a CLI scanner. #Produttività #Analisi #Ingegneria
🛡️🔒 AI AppSec Auditor & Immutable Ledger Architect (ai-appsec-auditor v1.1.0)
Offensive & Defensive Application Security Auditor (Red Team / Blue Team) and Cryptographic Immutable Ledger (SHA-256 Hash Chain) Architect for applications built with AI (Vibe Coding) — 100% Zero-Mock Production Standard.
(Versão em Português incluída abaixo / Portuguese version included below)
🌟 Why Every AI-Generated App Needs ai-appsec-auditor
AI coding assistants optimize for code that "works on the first try," frequently leaving behind critical security holes: broken access controls (IDOR), wide-open Supabase RLS policies (USING (true)), client-side price tampering, unverified payment webhooks, exposed NEXT_PUBLIC_ / VITE_ secret keys, and mutable financial/grade records.
ai-appsec-auditor acts as your Lead Red Team & Blue Team Security Engineer across a mandatory 4-Phase Audit Workflow:
- 🔍 Phase 1 — Attack Surface Scan (6 Categories / 20 Vectors
V01–V20): Deep line-by-line inspection across React, Next.js, TypeScript, Node.js, SQL/Supabase RLS, Payment Webhooks, and LLM APIs. - 🎯 Phase 2 — Educational Red Team Exploit Simulation: Shows step-by-step how an attacker would exploit each flaw in practice (
curlcommands, DevTools payload tampering, race conditions) and the real business impact. - 🛡️ Phase 3 — Production Blue Team Patch & Immutable Truth: Delivers complete, compilable replacement code (TypeScript + PostgreSQL/Supabase SQL) with Append-Only Immutable Ledgers and SHA-256 Hash Chains.
- 📋 Phase 4 — Anti-Breach Prompt Checklist: Copy-paste security guardrails to include in your future AI coding prompts.
⚔️ The 20 OWASP & Vibe Coding Attack Vectors Covered
| Category | Attack Vectors Audited (V01 – V20) |
|---|---|
| 1. Access Control & AuthZ | V01 IDOR (req.body.userId), V02 Supabase RLS Bypass (USING (true)), V03 Mass Assignment (role/isAdmin), V04 Client-Side-Only Gatekeeping |
| 2. Secrets & Config | V05 Secret Keys in Client Bundles (NEXT_PUBLIC_ / VITE_ / SERVICE_ROLE_KEY), V06 Stack Trace Leaks, V07 Wildcard CORS (*) |
| 3. Business Logic & Immutable Truth | V08 Client-Side Price Tampering (req.body.price), V09 Unverified Payment Webhooks (Missing HMAC-SHA256), V10 Balance Race Conditions (TOCTOU), V20 Mutable Ledger & History Tampering (.update/.delete on balances, grades, or audit logs) |
| 4. Injection & Execution | V11 SQL Injection (${...}), V12 XSS (dangerouslySetInnerHTML), V13 LLM Prompt Injection & Jailbreak, V14 SSRF |
| 5. Session & Authentication | V15 Missing Rate Limiting on Login/OTP/AI, V16 Unverified JWT (jwt.decode without verify), V17 Sensitive JWTs in localStorage |
| 6. Resources & Uploads | V18 Unrestricted File Uploads (Missing MIME/UUID validation), V19 Unbounded Database Queries (DoS) |
⛓️ V20: Immutable Truth Architecture (Append-Only Ledger & SHA-256 Hash Chain)
Critical records (wallet balances, financial transactions, school grades, and audit logs) must never be silently overwritten with UPDATE or erased with DELETE. ai-appsec-auditor provides ready-to-deploy PostgreSQL/Supabase SQL + TypeScript implementations featuring:
- Physical Database Mutation Lock:
BEFORE UPDATE OR DELETEtrigger raisingVIOLACAO_DE_IMUTABILIDADE. - Automatic Cryptographic Hash Chaining:
BEFORE INSERTtrigger computingSHA-256(id | entity_id | operation | amount | previous_hash)viapgcrypto. - Chain Integrity Verifier:
verificar_integridade_ledger()SQL function that detects any external database tampering.
🖥️ Built-in Automated CLI Security Scanner (auditar-seguranca.cjs)
Scan any file or entire project directory from the terminal before deploying:
node .agents/skills/ai-appsec-auditor/scripts/auditar-seguranca.cjs <path-to-file-or-folder>
🇵🇹 Resumo em Português (ai-appsec-auditor v1.1.0)
Auditor de Segurança Ofensiva e Defensiva (Red Team / Blue Team) e Arquiteto de Verdade Imutável (Append-Only Ledger & Hash Chain SHA-256) para aplicações criadas com IA (Vibe Coding).
- 20 Vetores Críticos Auditados (
V01aV20): IDOR, Bypass de Supabase RLS (USING (true)), Escalação de Privilégio, Vazamento de ChavesSERVICE_ROLE_KEY, Adulteração de Preço no Checkout, Forja de Webhooks sem HMAC, Condição de Corrida em Saldos, Violação de Verdade Imutável (V20), SQL Injection, XSS, Prompt Injection, SSRF,jwt.decodesemverifye mais. - 7 Pares Reais de Código (Vulnerável vs. Blindado): Inclui código TypeScript e SQL PostgreSQL/Supabase 100% real e compilável (
exemplos-reais-vulneravel-vs-blindado.ts) e scanner CLI automatizado (auditar-seguranca.cjs).


