Closed
Description
What version of regex are you using?
1.8.1 (latest)
Describe the bug at a high level.
The following code causes an integer-overflow panic in debug mode:
fn main() {
regex::Regex::new(" {2147483516}{2147483416}{5}").unwrap();
}
What are the steps to reproduce the behavior?
What is the actual behavior?
- integer overflow
- panic in debug mode
- seemingly returns the right answer (
Err(CompiledTooBig(10485760))
) anyway in release mode
What is the expected behavior?
Return the right answer (Err(CompiledTooBig(10485760))
) without integer overflow.
Acknowledgement
The fuzzing infrastructure that found this bug was provided to and integrated into surrealdb
by Google OSS Fuzz and @silvergasp, respectively.
The consensus from reporting this as a security issue was that it shouldn't be treated as one as users can avoid panics using catch_unwind
. The security policy and/or documentation may be updated to reflect this.