This weakness occurs when a regular expression is too permissive, failing to properly validate or sanitize input by allowing unintended values or patterns.
A permissive regex often arises from forgetting to anchor the pattern to the start (^) and end ($) of the input string. This causes a partial match, where the system accepts any substring that fits the pattern, rather than validating the entire input. For example, a regex meant to validate a 5-digit ZIP code like \d{5} would incorrectly accept '12345' within 'abc12345def', leading to incomplete validation. Other common mistakes include using overly broad wildcards (like .*) instead of specific character classes, or crafting patterns that fail to exclude dangerous or malformed data. This lax validation can open the door to data corruption, injection attacks, or logic flaws downstream, as the application processes input it assumed was already safe.
Impact: Bypass Protection Mechanism
perl
perl
python
python