Inclusive or Exploitable? Cultural Exclusion and ReDoS Vulnerabilities in LLM-Generated Input Validation Code
Large language models (LLMs) increasingly write the input validators that guard web registration forms, so the generated code decides both who can sign up and which untrusted input reaches the application. We evaluated 1920 JavaScript validators generated by four LLMs (GPT-5 mini, Gemini 3.8 Flash, DeepSeek-V3.2 and Llama 3.1 8B) for six personal-data fields, varying prompt language, usage context and an explicit inclusivity instruction. Each validator was executed against 229 valid inputs drawn from documented naming, telephony and addressing conventions and 43 invalid ones, and its regular expressions were tested for Regular Expression Denial of Service (ReDoS) with static analysis and a growth-based test of the whole function. Without the instruction, validators rejected 46.1% of valid non-Anglo-American inputs, mainly because of ASCII-only character classes. A one-sentence inclusivity instruction cut false rejection to 20.5% (odds ratio 0.19) but loosened structural checks on malformed input, and helped the locally served Llama 3.1 8B configuration far less. For GPT-5 mini, the same sentence raised confirmed ReDoS-vulnerable validators from 0/239 to 32/240, 10 of them exponential and exploitable with inputs under 70 characters; fewer than a third of statically flagged validators were confirmed as exploitable. Inclusive validation is cheap to request, but it should not be deployed without automated security checks.
Authors
- Jaime Govea (ORCID: https://orcid.org/0009-0005-5706-8422)
- Rommel Gutierrez (ORCID: https://orcid.org/0009-0004-3230-4129)
Institutions
- Universidad de Las Américas (EC)
Publication Details
- Journal
- Future Internet
- Published
- 2026-12-02
- DOI
- https://doi.org/10.3390/fi18120666
- Primary Topic
- Web Application Security Vulnerabilities
- Type
- article
- Field-Weighted Citation Impact
- 0.00