Vulnerabilities in pkg:npm/sqlite3
PACKAGECVE-2022-43441 is a HIGH (CVSS 8.1) sqlite vulnerable to code execution vulnerability (CWE-913: Improper Control of Dynamically-Managed Code Resources) affecting Sqlite3 libraries in the npm ecosystem. The issue involves sqlite vulnerable to code execution due to object coercion. Remediation is available by upgrading affected packages to version 5.1.5.
pkg:npm/sqlite3
Vulnerability advisories affecting package pkg:npm/sqlite3. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-jqv5-7xpx-qj74 | CVE-2022-43441 | HIGH | sqlite vulnerable to code execution due to Object coercion |
| GHSA-9qrh-qjmc-5w2p | CVE-2022-21227 | HIGH | Denial-of-Service when binding invalid parameters in sqlite3 |
CVE-2022-43441 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-43441
To remediate this vulnerability, upgrade all affected Sqlite3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install sqlite3@5.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls sqlite3
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-43441, inspect your project dependencies using npm:
npm ls sqlite3
Analyze the terminal output to locate any version of Sqlite3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.1.5), your application is affected.
Note: The npm ls sqlite3 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources, where the product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. In Sqlite3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-43441 Affected Sqlite3 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sqlite3
|
npm |
≥ 5.0.0
< 5.1.5
|
5.1.5
|
References
Frequently Asked Questions
What is CVE-2022-43441?
Which Sqlite3 versions are affected?
What version fixes CVE-2022-43441?
Is sqlite3 affected?
What is the CVSS score of CVE-2022-43441?
What CWE is associated with CVE-2022-43441?
How can I check npm dependencies for CVE-2022-43441?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jqv5-7xpx-qj74",
"modified" : "2023-03-16T21:34:27Z",
"published" : "2023-03-13T20:00:52Z",
"aliases" : [ "CVE-2022-43441" ],
"summary" : "sqlite vulnerable to code execution due to Object coercion",
"details" : "### Impact\n\nDue to the underlying implementation of `.ToString()`, it's possible to execute arbitrary JavaScript, or to achieve a denial-of-service, if a binding parameter is a crafted Object.\n\nUsers of `sqlite3` v5.0.0 - v5.1.4 are affected by this.\n\n### Patches\n\nFixed in v5.1.5. All users are recommended to upgrade to v5.1.5 or later.\n\n### Workarounds\n\n* Ensure there is sufficient sanitization in the parent application to protect against invalid values being supplied to binding parameters.\n\n### References\n\n* Commit: https://github.com/TryGhost/node-sqlite3/commit/edb1934dd222ae55632e120d8f64552d5191c781\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Email us at [security@ghost.org](mailto:security@ghost.org)\n\nCredits: Dave McDaniel of Cisco Talos",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "sqlite3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.1.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/TryGhost/node-sqlite3/security/advisories/GHSA-jqv5-7xpx-qj74"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-43441"
}, {
"type" : "WEB",
"url" : "https://github.com/TryGhost/node-sqlite3/commit/edb1934dd222ae55632e120d8f64552d5191c781"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/TryGhost/node-sqlite3"
}, {
"type" : "WEB",
"url" : "https://talosintelligence.com/vulnerability_reports/TALOS-2022-1645"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-913", "CWE-915" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-13T20:00:52Z",
"nvd_published_at" : "2023-03-16T21:15:00Z"
}
}