Vulnerabilities in pkg:npm/whatsapp-api-js
PACKAGECVE-2024-45607 is a MODERATE (CVSS 5.8) whatsapp-api-js fails to validate message's vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Whatsapp api js libraries in the npm ecosystem. The issue involves whatsapp-api-js fails to validate message's signature. Remediation is available by upgrading affected packages to version 4.0.3.
pkg:npm/whatsapp-api-js
Vulnerability advisories affecting package pkg:npm/whatsapp-api-js. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-mwhf-vhr5-7j23 | CVE-2024-45607 | MODERATE | whatsapp-api-js fails to validate message's signature |
CVE-2024-45607 at a Glance
Security Impact
CVSS: 5.8
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:N/S:C/C:N/I:L/A:N).
How to Fix CVE-2024-45607
To remediate this vulnerability, upgrade all affected Whatsapp api js 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 whatsapp-api-js@4.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls whatsapp-api-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-45607, inspect your project dependencies using npm:
npm ls whatsapp-api-js
Analyze the terminal output to locate any version of Whatsapp api js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.3), your application is affected.
Note: The npm ls whatsapp-api-js 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-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Whatsapp api js, 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-45607 Affected Whatsapp api js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
whatsapp-api-js
|
npm |
≥ 4.0.0
< 4.0.3
|
4.0.3
|
References
Frequently Asked Questions
What is CVE-2024-45607?
Which Whatsapp api js versions are affected?
What version fixes CVE-2024-45607?
Is whatsapp-api-js affected?
What is the CVSS score of CVE-2024-45607?
What CWE is associated with CVE-2024-45607?
How can I check npm dependencies for CVE-2024-45607?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mwhf-vhr5-7j23",
"modified" : "2024-09-12T21:39:35Z",
"published" : "2024-09-12T21:29:17Z",
"aliases" : [ "CVE-2024-45607" ],
"summary" : "whatsapp-api-js fails to validate message's signature",
"details" : "### Impact\nIncorrect Access Control, anyone using the post or verifyRequestSignature methods to handle messages is impacted.\n\n### Patches\nPatched in version 4.0.3.\n\n### Workarounds\nIt's possible to check the payload validation using the WhatsAppAPI.verifyRequestSignature and expect false when the signature is valid.\n\n```ts\nfunction doPost(payload, header_signature) {\n if (whatsapp.verifyRequestSignature(payload.toString(), header_signature) {\n throw 403;\n }\n \n // Now the payload is correctly verified\n whatsapp.post(payload);\n}\n```\n\n### References\nhttps://github.com/Secreto31126/whatsapp-api-js/pull/371\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "whatsapp-api-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Secreto31126/whatsapp-api-js/security/advisories/GHSA-mwhf-vhr5-7j23"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45607"
}, {
"type" : "WEB",
"url" : "https://github.com/Secreto31126/whatsapp-api-js/pull/371"
}, {
"type" : "WEB",
"url" : "https://github.com/Secreto31126/whatsapp-api-js/commit/56620c65126427496a94d176082fbd8393a95b6d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Secreto31126/whatsapp-api-js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-347" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-12T21:29:17Z",
"nvd_published_at" : "2024-09-12T20:15:05Z"
}
}