Title: ReDoS risk: user-controlled sensitivePatterns passed to RegExp without validation
Labels: security, critical, response-analyzer
Body:
Problem
User-controlled sensitivePatterns from config are passed into new RegExp(pattern, "i") in response-analyzer.ts without validation or sanitization. Malicious or poorly chosen patterns (e.g. ReDoS like (a+)+$ or (a|a?)+b) can cause catastrophic backtracking when run against large response bodies.
Why this matters
During a red-team run, every agent response is checked against these patterns. A single pathological regex can block the Node event loop and freeze the entire scan — a denial-of-service on the red-team operator.
Impact
Critical — Entire real-time scan can hang indefinitely; operational and availability impact.
Files / location
lib/response-analyzer.ts — lines ~18–19, 29–31 (pattern → new RegExp)
lib/types.ts — Config.sensitivePatterns
config.json / config.example.json — pattern list
Details
Documented as Issue ID. Mitigations: allowlist safe pattern shapes, timeout per match, or use a safe matcher for simple literals.
Issue ID:
Category: Security Risk
File/Location: lib/response-analyzer.ts (lines 18–19, 29–31)
Problem Statement: User-controlled sensitivePatterns from config are passed directly into new RegExp(pattern, "i") without validation or sanitization.
Why This Is a Problem: Malicious or poorly chosen regex patterns (e.g. ReDoS patterns like (a+)+$ or (a|a?)+b) can cause catastrophic backtracking and block the event loop, leading to denial of service.
Impact Level: Critical
Notes: Config may be edited by admins or generated; any pattern that can run against large response bodies is a risk.
Title: ReDoS risk: user-controlled
sensitivePatternspassed toRegExpwithout validationLabels:
security,critical,response-analyzerBody:
Problem
User-controlled
sensitivePatternsfrom config are passed intonew RegExp(pattern, "i")inresponse-analyzer.tswithout validation or sanitization. Malicious or poorly chosen patterns (e.g. ReDoS like(a+)+$or(a|a?)+b) can cause catastrophic backtracking when run against large response bodies.Why this matters
During a red-team run, every agent response is checked against these patterns. A single pathological regex can block the Node event loop and freeze the entire scan — a denial-of-service on the red-team operator.
Impact
Critical — Entire real-time scan can hang indefinitely; operational and availability impact.
Files / location
lib/response-analyzer.ts— lines ~18–19, 29–31 (pattern →new RegExp)lib/types.ts—Config.sensitivePatternsconfig.json/config.example.json— pattern listDetails
Documented as Issue ID. Mitigations: allowlist safe pattern shapes, timeout per match, or use a safe matcher for simple literals.
Issue ID:
Category: Security Risk
File/Location:
lib/response-analyzer.ts(lines 18–19, 29–31)Problem Statement: User-controlled
sensitivePatternsfrom config are passed directly intonew RegExp(pattern, "i")without validation or sanitization.Why This Is a Problem: Malicious or poorly chosen regex patterns (e.g. ReDoS patterns like
(a+)+$or(a|a?)+b) can cause catastrophic backtracking and block the event loop, leading to denial of service.Impact Level: Critical
Notes: Config may be edited by admins or generated; any pattern that can run against large response bodies is a risk.