Vulnerabilities in pkg:npm/node-twain
PACKAGECVE-2024-21525 is a HIGH (CVSS 8.3) node-twain vulnerable to improper check vulnerability (CWE-703: Improper Check or Handling of Exceptional Conditions) affecting Node twain libraries in the npm ecosystem. The issue involves node-twain vulnerable to improper check or handling of exceptional conditions. Remediation is available in the latest vendor maintenance releases.
pkg:npm/node-twain
Vulnerability advisories affecting package pkg:npm/node-twain. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-wxr3-2hgv-qm8f | CVE-2024-21525 | HIGH | node-twain vulnerable to Improper Check or Handling of Exceptional Conditions |
CVE-2024-21525 at a Glance
Security Impact
CVSS: 8.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L).
How to Fix CVE-2024-21525
To remediate this vulnerability, upgrade all affected Node twain 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 node-twain@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls node-twain
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-21525, inspect your project dependencies using npm:
npm ls node-twain
Analyze the terminal output to locate any version of Node twain in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls node-twain 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-703: Improper Check or Handling of Exceptional Conditions, where the product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product. In Node twain, 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-2024-21525 Affected Node twain Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
node-twain
|
npm |
≤ 0.0.16
|
|
References
Frequently Asked Questions
What is CVE-2024-21525?
Which Node twain versions are affected?
What version fixes CVE-2024-21525?
Is node-twain affected?
What is the CVSS score of CVE-2024-21525?
What CWE is associated with CVE-2024-21525?
How can I check npm dependencies for CVE-2024-21525?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wxr3-2hgv-qm8f",
"modified" : "2024-07-10T21:29:30Z",
"published" : "2024-07-10T06:33:52Z",
"aliases" : [ "CVE-2024-21525" ],
"summary" : "node-twain vulnerable to Improper Check or Handling of Exceptional Conditions",
"details" : "All versions of the package node-twain are vulnerable to Improper Check or Handling of Exceptional Conditions due to the length of the source data not being checked. Creating a new twain.TwainSDK with a productName or productFamily, manufacturer, version.info property of length >= 34 chars leads to a buffer overflow vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "node-twain"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.0.16"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21525"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/dellalibera/55b87634a6c360e5be22a715f0566c99"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Luomusha/node-twain"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-NODETWAIN-6421153"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-703" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-10T21:29:30Z",
"nvd_published_at" : "2024-07-10T05:15:11Z"
}
}