-
Notifications
You must be signed in to change notification settings - Fork 15
security: [LOW] Potential ReDoS in markdown table regex #3199
Copy link
Copy link
Open
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns
Description
Summary
The markdown table parsing regex in the Slack bot helper uses nested quantifiers that could cause catastrophic backtracking (ReDoS) on malicious input.
Location
.claude/skills/setup-spa/helpers.ts:668 — MARKDOWN_TABLE_RE
Vulnerability
export const MARKDOWN_TABLE_RE = /\|.+\|\n\|[-: |]+\|\n(?:\|.+\|\n?)*/g;The .+ and (?:...)* nested quantifiers can cause exponential backtracking if a Slack user sends a crafted markdown payload with thousands of pipe characters but no valid table structure.
Risk
- Severity: LOW
- Impact: CPU exhaustion / denial of service (bot hangs)
- Probability: Low (requires malicious crafted input in Slack messages)
- Exploitability: Medium (publicly reachable via Slack)
Recommendation
- Add input length limit before regex matching:
if (raw.length > 50000) return { clean: raw, tables: [] };
- Or replace with a linear-time parser that doesn't use nested quantifiers
Context
Filed by automated security scan (2026-04-06)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in-progressIssue is being actively worked onIssue is being actively worked onsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns