You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent ReDoS vulnerability in HTML payload unwrapping regex
Fixed a polynomial Regular Expression Denial of Service (ReDoS) vulnerability in the HTML payload unwrapping function. The base64 capture group in the regex pattern was changed from greedy (`+`) to non-greedy (`+?`) to prevent exponential backtracking when processing malicious input.
**Security Impact:**
- Prevents potential DoS attacks through crafted HTML input that could cause excessive CPU usage
- Maintains the same functional behavior for legitimate base64 payload extraction
**Technical Details:**
- Modified regex pattern in `lib/tdf3/src/utils/unwrap.ts` line 6
- Changed `([a-zA-Z0-9+/=]+)` to `([a-zA-Z0-9+/=]+?)` to use non-greedy matching
- This eliminates catastrophic backtracking scenarios while preserving correct base64 extraction
0 commit comments