Description
isValidPhoneNumber() accepts phone numbers with incorrect NSN lengths for Paraguay and Uruguay, allowing invalid numbers to pass validation.
Affected countries
Uruguay (UY) — +598
Per URSEC's closed numbering plan (2010), all Uruguayan numbers (fixed and mobile) are exactly 8 NSN digits. This has been the case for 15 years.
The library accepts 7 NSN digits as valid:
isValidPhoneNumber('+5989512345') // 7 NSN digits → true ❌ should be false
isValidPhoneNumber('+59895527722') // 8 NSN digits → true ✅
Paraguay (PY) — +595
Per ITU's numbering plan for Paraguay (2002), all Paraguayan numbers (fixed and mobile) are exactly 9 NSN digits.
The library accepts 7, 8, 10 and 11 NSN digits as valid:
isValidPhoneNumber('+5959811234') // 7 NSN digits → true ❌ should be false
isValidPhoneNumber('+59598112345') // 8 NSN digits → true ❌ should be false
isValidPhoneNumber('+595981123456') // 9 NSN digits → true ✅
isValidPhoneNumber('+5959811234567') // 10 NSN digits → true ❌ should be false
isValidPhoneNumber('+59598112345678')// 11 NSN digits → true ❌ should be false
Expected E.164 format
| Country |
Format |
Total E.164 length |
| Uruguay |
+598 + 8 digits |
12 chars |
| Paraguay |
+595 + 9 digits |
13 chars |
Versions tested
1.12.38 — affected
1.12.40 (latest) — still affected
Additional notes
validatePhoneNumberLength() returns undefined for all these cases (instead of TOO_SHORT or TOO_LONG), and isPossiblePhoneNumber() also returns true, suggesting the metadata length ranges for these countries are not correctly defined.
References
Description
isValidPhoneNumber()accepts phone numbers with incorrect NSN lengths for Paraguay and Uruguay, allowing invalid numbers to pass validation.Affected countries
Uruguay (UY) —
+598Per URSEC's closed numbering plan (2010), all Uruguayan numbers (fixed and mobile) are exactly 8 NSN digits. This has been the case for 15 years.
The library accepts 7 NSN digits as valid:
Paraguay (PY) —
+595Per ITU's numbering plan for Paraguay (2002), all Paraguayan numbers (fixed and mobile) are exactly 9 NSN digits.
The library accepts 7, 8, 10 and 11 NSN digits as valid:
Expected E.164 format
+598+ 8 digits+595+ 9 digitsVersions tested
1.12.38— affected1.12.40(latest) — still affectedAdditional notes
validatePhoneNumberLength()returnsundefinedfor all these cases (instead ofTOO_SHORTorTOO_LONG), andisPossiblePhoneNumber()also returnstrue, suggesting the metadata length ranges for these countries are not correctly defined.References