UNPKG

ubon

Version:

Security scanner for AI-generated apps (Cursor, Lovable, Windsurf, v0). Catches hardcoded secrets, prompt injection, hallucinated imports, Server Actions / Edge runtime mistakes, and the vibe-coded vulnerabilities traditional linters miss.

28 lines 1.13 kB
import { ScanOptions, ScanResult } from '../types'; import { BaseScanner } from './base-scanner'; /** * ReactPatternsScanner — the "vibe-coded React" class of bugs. * * Targets AI-generated React output: array-index keys, render-time handler * calls, in-place state mutation, useEffect hazards (missing cleanup, async * body, no AbortController, stale closures), lazy-init mistakes, conditional * hooks, and JWTs in localStorage. * * All detections are regex/heuristic. Each finding carries a confidence in * [0.6, 0.95] and a `confidenceReason` so the reporter can triage noise. */ export declare class ReactPatternsScanner extends BaseScanner { name: string; scan(options: ScanOptions): Promise<ScanResult[]>; private push; private detectIndexAsKey; private detectHandlerInvokedAtRender; private detectStateMutation; private detectUseEffectHazards; private findTopLevelComma; private detectUseStateEagerInit; private detectConditionalHook; private detectRefAssignDuringRender; private detectTokenInLocalStorage; } //# sourceMappingURL=react-patterns-scanner.d.ts.map