Regular Expression Denial-of-Service in npm schema-inspector
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | schema-inspector | < 2.0.0 | 2.0.0 |
References
- https://github.com/schema-inspector/schema-inspector/security/advisories/GHSA-f38p-c2gq-4pmr
- https://nvd.nist.gov/vuln/detail/CVE-2021-21267
- https://gist.github.com/mattwelke/b7f42424680a57b8161794ad1737cd8f
- https://github.com/schema-inspector/schema-inspector/releases/tag/2.0.0
- https://security.netapp.com/advisory/ntap-20210528-0006
- https://www.npmjs.com/package/schema-inspector
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Weakness (CWE)
CWE-20, CWE-400- Platform
- npm
- Package
schema-inspector- Disclosed
- 19.03.2021
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-f38p-c2gq-4pmr - CC BY 4.0
Vulnerability history: schema-inspector
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 06.2020 03.2021
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 1
Disclosures per year
- 2020: 1
- 2021: 1
- 2022: 0
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Regular Expression Denial-of-Service in npm schema-inspector this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.