Inefficient Regular Expression Complexity in v8n
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.
| Package | Affected versions | Patched versions |
|---|---|---|
v8nnpm | < 1.5.1 | 1.5.1 |
Affected products
1Patches
192393862156ffix inefficient regular expressions on lowercase and uppercase rules
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- github.com/advisories/GHSA-xrx9-gj26-5wx9ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-35923ghsaADVISORY
- github.com/imbrn/v8n/commit/92393862156fad190c05ec3f6e2bc73308dcd2f9ghsax_refsource_MISCWEB
- github.com/imbrn/v8n/security/advisories/GHSA-xrx9-gj26-5wx9ghsax_refsource_CONFIRMWEB
- huntr.dev/bounties/2d92f644-593b-43b4-bfd1-c8042ac60609ghsaWEB
- huntr.dev/bounties/2d92f644-593b-43b4-bfd1-c8042ac60609/mitrex_refsource_MISC
News mentions
0No linked articles in our index yet.