argparse is vulnerable to Regular Expression Denial of Service (ReDoS)
51
CVE Score
Medium
Regular Expression Denial of Service (ReDoS)
argparse registers an int type converter that tests argument values against a regex with nested quantifiers over digits before conversion. A multi digit value ending in an invalid character grows the regex evaluation exponentially, blocking the process for a long time or crashing it under the library's default error handling. The parser reaches this check whenever parse_args processes an argument bound to the int type, including argv built from untrusted request data. The fix replaces the ambiguous repeated optional underscore quantifier with an unambiguous underscore separated digit pattern, removing the backtracking blowup.
Upgrade the argparse library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you define an argument with the int type that receives externally influenced values.
3.0.0 - 3.0.2
Fixed in 3.0.3argparse is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 3.0.0 - 3.0.2.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.