VYPR
High severityNVD Advisory· Published Aug 2, 2022· Updated Apr 22, 2025

Inefficient Regular Expression Complexity in v8n

CVE-2022-35923

Description

v8n is a javascript validation library. Versions of v8n prior to 1.5.1 were found to have an inefficient regular expression complexity in the lowercase() and uppercase() regex which could lead to a denial of service attack. In testing of the lowercase() function a payload of 'a' + 'a'.repeat(i) + 'A' with 32 leading characters took 29443 ms to execute. The same issue happens with uppercase(). Users are advised to upgrade. There are no known workarounds for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
v8nnpm
< 1.5.11.5.1

Affected products

1

Patches

1
92393862156f

fix inefficient regular expressions on lowercase and uppercase rules

https://github.com/imbrn/v8nimbrnJul 1, 2022via ghsa
1 file changed · +8 2
  • src/v8n.js+8 2 modified
    @@ -189,9 +189,15 @@ const availableRules = {
     
       pattern: expected => value => expected.test(value),
     
    -  lowercase: () => value => /^([a-z]+\s*)+$/.test(value),
    +  lowercase: () => value => {
    +    return (
    +      typeof value === 'boolean' ||
    +      (value === value.toLowerCase() && value.trim() !== '')
    +    );
    +  },
     
    -  uppercase: () => value => /^([A-Z]+\s*)+$/.test(value),
    +  uppercase: () => value =>
    +    value === value.toUpperCase() && value.trim() !== '',
     
       vowel: () => value => /^[aeiou]+$/i.test(value),
     
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.