Advisories for Pypi/Wcmatch package

2026

wcmatch: Polynomial-time ReDoS when matching untrusted names against multi-star patterns (default flags)

With default flags, a pattern that contains several * wildcards takes polynomial time, O(n^k) for k stars, to reject a crafted file name. The pattern is an ordinary developer constant such as _*_.csv; only the string being matched comes from the attacker. A 255-byte file name (the maximum on common filesystems) takes 73 s with fnmatch.fnmatch() and 86 s with glob.globmatch(). The standard library's fnmatch handles the same input in …