CVE-2019-18413 SQL Injection and Cross-site Scripting in class-validator

Low 3.7 Published Updated

Attackers can bypass input validation in class-validator by overwriting internal attributes, potentially enabling SQL injection or XSS attacks.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2019-18413?

CVE-2019-18413 is a low-severity missing authorization vulnerability in n/a, published on 24 Oct 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In TypeStack class-validator 0.10.2, validate() input validation can be bypassed because certain internal attributes can be overwritten via a conflicting name. Even though there is an optional forbidUnknownValues parameter that can be used to reduce the risk of this bypass, this option is not documented and thus most developers configure input validation in the vulnerable default manner. With this vulnerability, attackers can launch SQL Injection or XSS attacks by injecting arbitrary malicious input. NOTE: a software maintainer agrees with the "is not documented" finding but suggests that much of the responsibility for the risk lies in a different product.

Weakness: CWE-89, CWE-79

Which versions are affected by CVE-2019-18413?

2 open source packages ship an affected version, including class-validator. It affects 1 product.

PackageAffectedFixed in
class-validator npmAll versions0.14.0
class-validator npmAll versions0.14.0

Products include Typestack Class-Validator Project Typestack Class-Validator.

How do I fix CVE-2019-18413?

Upgrade class-validator to 0.14.0 or later.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2019-18413 being exploited?

There is no known exploitation of CVE-2019-18413 in the wild and no public exploit code.

Sources

Also known as GHSA-fj58-h2fr-3pp2.

Is CVE-2019-18413 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free