CoolFace
Modelpublic

kodareef5/onnx-redos-poc

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
Model Card

ONNX ReDoS PoC (CWE-1333)

Vulnerability

The RegexFullMatch reference operator uses Python re.compile() on patterns from the ONNX model. Python's re engine is vulnerable to catastrophic backtracking. The ONNX spec mandates re2 (linear time), but the implementation uses re (exponential).

Reproduce

bash
pip install onnx
python poc.py

Pattern (a+)+b with input "aaa..." causes exponential CPU consumption.