CVE-2021-21267
JSON

7.5high

Regular Expression Denial-of-Service in npm schema-inspector

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
2.09% (higher than 82% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-f38p-c2gq-4pmr

Description

Schema-Inspector is an open-source tool to sanitize and validate JS objects (npm package schema-inspector). In before version 2.0.0, email address validation is vulnerable to a denial-of-service attack where some input (for example `a@0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.`) will freeze the program or web browser page executing the code. This affects any current schema-inspector users using any version to validate email addresses. Users who do not do email validation, and instead do other types of validation (like string min or max length, etc), are not affected. Users should upgrade to version 2.0.0, which uses a regex expression that isn't vulnerable to ReDoS.

Affected

Product or packageVersionsReported by
schema-inspector schema-inspector< 2.0.0CVE List
schema-inspector (npm)before 2.0.0GitHub Advisory Database
schema-inspector_project schema-inspectorbefore 2.0.0NVD
netapp e-series_performance_analyzerNot specifiedNVD
netapp oncommand_insightNot specifiedNVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

Schema-Inspector is an open-source tool to sanitize and validate JS objects (npm package schema-inspector). In before version 2.0.0, email address validation is vulnerable to a denial-of-service attack where some input (for example `a@0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.`) will freeze the program or web browser page executing the code. This affects any current schema-inspector users using any version to validate email addresses. Users who do not do email validation, and instead do other types of validation (like string min or max length, etc), are not affected. Users should upgrade to version 2.0.0, which uses a regex expression that isn't vulnerable to ReDoS.

GitHub Advisory Database
Impact

What kind of vulnerability is it? Who is impacted? Email address validation is vulnerable to a denial-of-service attack where some input (for example a@0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.) will freeze the program or web browser page executing the code. This affects any current schema-inspector users using any version to validate email addresses. Users who do not do email validation, and instead do other types of validation (like string min or max length, etc), are not affected.

Patches

Has the problem been patched? What versions should users upgrade to? Users should upgrade to version 2.0.0, which uses a regex expression that isn't vulnerable to ReDoS. The new regex expression is more limited in what it can check, so it is more flexible than the one used before. Therefore, this was a new major version instead of a new patch version to warn people upgrading that they should make sure the email validation still works for their use case.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading? If a user chooses to not upgrade, the only known workaround would be to stop using the email validation feature in the library. The user could, for example, accept the email address into their system but save it in a "not yet validated" state in their system until a verification email is sent to it (to determine whether the email is valid and belongs to the form submitter). Note that this is the preferred way of validating email addresses anyways.

References

Are there any links users can visit to find out more? https://gist.github.com/mattwelke/b7f42424680a57b8161794ad1737cd8f

For more information

If you have any questions or comments about this advisory, you can create an issue in this repository.

NVD (es)

Schema-Inspector es una herramienta de código abierto para sanear y comprobar objetos JS (el inspector de esquema del paquete npm).&#xa0;versiones anteriores a 2.0.0, la comprobación de la dirección de correo electrónico es vulnerable a un ataque de denegación de servicio donde alguna entrada (por ejemplo, "a@0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 .0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 ") congelará el programa o la página del navegador web que ejecuta el código.&#xa0;Esto afecta a cualquier usuario actual del inspector de esquemas que usan cualquier versión para comprobar direcciones de correo electrónico.&#xa0;Los usuarios que no realizan la comprobación por correo electrónico y, en su lugar, realizan otros tipos de comprobación (como la longitud mínima o máxima de la cadena, etc.), no están afectados.&#xa0;Los usuarios deben actualizar a la versión 2.0.0, que usa una expresión regular que no es vulnerable a ReDoS

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21267 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-f38p-c2gq-4pmr changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21267 changed 2026-06-17Public domain