The vulnerability exists in the isLength function within the validator package. The function's purpose is to check if a string's length falls within a specified range. The flaw is in how the function calculates the string's length when Unicode variation selectors (U+FE0E, U+FE0F) are present. The original code used a regular expression that counted each individual variation selector. However, the Unicode standard specifies that a sequence of these selectors following a character should be treated as a single grapheme cluster, not adding to the visual length. By sending a string with multiple variation selectors in a sequence (e.g., 'A\uFE0F\uFE0F\uFE0F'), an attacker could make the isLength function calculate a much shorter length than the actual string length. This bypasses the intended validation. The patch addresses this by changing the regex to /[^\\uFE0F\\uFE0E][\\uFE0F\\uFE0E]/g, which only counts a variation selector if it is preceded by a character that is not a variation selector, thereby correcting the length calculation for sequences. The vulnerable function is clearly isLength as identified in the commit d457ecaf55b0f3d8bd379d82757425d0d13dd382 which modifies src/lib/isLength.js.