CVE-2019-18413: SQL Injection and Cross-site Scripting in class-validator
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.30925%
CWE
Published
10/12/2021
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
class-validator | npm | < 0.14.0 | 0.14.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The core vulnerability stems from the validate() function's default handling of unknown values. Before v0.14.0, forbidUnknownValues defaulted to false, allowing attackers to submit payloads with properties that conflict with internal validation metadata (like constructor properties). This is explicitly demonstrated in GitHub Issue #438's PoC where proto injection bypasses validation. The validate() function is the primary entry point for validation and its default configuration was the root cause. The vulnerability was resolved in v0.14.0 by changing the default forbidUnknownValues to true, confirming this function's central role in the security issue.