Intel

AIKIDO-2026-824389

argparse is vulnerable to Regular Expression Denial of Service (ReDoS)

GHSA-gh4w-rw27-p87xPublished Oct 19, 2026
October 19, 2026

51

CVE Score

Medium

Regular Expression Denial of Service (ReDoS)

Are you affected? Scan for Free

TL;DR

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.

How do I fix this?

Upgrade the argparse library to the patch version.

Who does this affect?

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.

Package

Versions

3.0.0 - 3.0.2

Fixed in 3.0.3

Background info

argparse is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 3.0.0 - 3.0.2.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea