Denial of Service Vulnerability in node-sqlite3 Package
Summary
CVE-2022-21227: The package sqlite3 before 5.0.3 are vulnerable to Denial of Service (DoS) which will invoke the toString function of the passed parameter. Affects node-sqlite3 across 2 version ranges.
< 5.0.0+ds1-1+deb11u1
< 593c9d498be2510d286349134537e3bf89401c4a
Fixed in 5.0.0+ds1-1+deb11u1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The node-sqlite3 package is a popular Node.js library that provides a simple interface for interacting with SQLite databases. It is widely used for its efficiency and ease of integration in various applications. However, prior to version 5.0.3, the package is susceptible to a Denial of Service (DoS) vulnerability that can disrupt the normal operation of applications relying on it.
Vulnerability Detail
The vulnerability arises from the improper handling of the toString function when an invalid Function object is passed as a parameter. This can lead to a crash of the V8 engine, which is the JavaScript engine used by Node.js, resulting in a Denial of Service condition. Attackers can exploit this vulnerability by sending crafted inputs that trigger the crash, thereby affecting the availability of the application.
How To Fix
Minimum fixed version
5.0.0+ds1-1+deb11u1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade node-sqlite3
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing input validation to ensure that only valid Function objects are passed to the toString function. This can help mitigate the risk of triggering the vulnerability until a proper update can be applied.
Conclusion
The node-sqlite3 package has a critical Denial of Service vulnerability that can affect applications using it. It is essential to update to a secure version to mitigate risks. Additionally, utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.
See every vulnerability recorded for node-sqlite3 →
FAQ
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
All versions of node-sqlite3 prior to 5.0.3 are affected by this vulnerability.
Exploitation of this vulnerability can lead to a Denial of Service, causing applications to crash and become unavailable.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just a manifest file like package-lock.json.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-sqlite3.