Incomplete Filtering of One or More Instances of Special Elements Affecting validator package, versions <13.15.22


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-VALIDATOR-13653476
  • published26 Nov 2025
  • disclosed18 Oct 2025
  • creditKarol Wrótniak

Introduced: 18 Oct 2025

CVE-2025-12758  (opens in a new tab)
CWE-792  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade validator to version 13.15.22 or higher.

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Incomplete Filtering of One or More Instances of Special Elements in the isLength() function that does not take into account Unicode variation selectors (\uFE0F, \uFE0E) appearing in a sequence which lead to improper string length calculation. This can lead to an application using isLength for input validation accepting strings significantly longer than intended, resulting in issues like data truncation in databases, buffer overflows in other system components, or denial-of-service.

PoC

Input;

const validator = require('validator');

console.log(Is &quot;test&quot; (String.length: ${&#39;test&#39;.length}) length less than or equal to 3? ${validator.isLength(&#39;test&#39;, { max: 3 })}); console.log(Is &quot;test&quot; (String.length: ${&#39;test&#39;.length}) length less than or equal to 4? ${validator.isLength(&#39;test&#39;, { max: 4 })}); console.log(Is &quot;test\uFE0F\uFE0F\uFE0F\uFE0F&quot; (String.length: ${&#39;test\uFE0F\uFE0F\uFE0F\uFE0F&#39;.length}) length less than or equal to 4? ${validator.isLength(&#39;test\uFE0F\uFE0F\uFE0F&#39;, { max: 4 })});

Output:

Is "test" (String.length: 4) length less than or equal to 3? false
Is "test" (String.length: 4) length less than or equal to 4? true
Is "test️️️️" (String.length: 8) length less than or equal to 4? true

CVSS Base Scores

version 4.0
version 3.1