Run SAST/dependency audit, fix vulnerabilities until clean.
Start the "Security Scan Loop" loop. - Goal: Zero high/critical vulnerabilities in dependencies and zero SAST findings in application code. - Max iterations: 8 - Between iterations run: `npm audit --audit-level=high && npx eslint --rule 'no-eval: error' src/` - Exit when: `npm audit` reports no high/critical vulnerabilities AND SAST checks pass clean. Steps: 1. Run dependency audit: `npm audit` 2. Run static analysis for security patterns (eval, innerHTML, SQL concatenation, hardcoded secrets) 3. If both are clean, stop — exit condition met 4. For dependency vulnerabilities: - If a patch exists: update to the patched version - If no patch: evaluate alternatives, or add to audit exceptions with documented justification 5. For SAST findings: - Replace dangerous patterns with safe equivalents (innerHTML → textContent, eval → JSON.parse, string concat → parameterized queries) 6. Re-run both scans to verify fixes 7. Repeat until clean Self-pacing instructions: After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when exit condition passes or max iterations reached. Give a short status update each pass.
How it works