Improper Verification of Cryptographic Signature Affecting whatsapp-api-js package, versions >=4.0.0 <4.0.3
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-WHATSAPPAPIJS-7945494
- published 13 Sep 2024
- disclosed 12 Sep 2024
- credit Felix Arjuna
Introduced: 12 Sep 2024
New CVE-2024-45607 Open this link in a new tabHow to fix?
Upgrade whatsapp-api-js
to version 4.0.3 or higher.
Overview
whatsapp-api-js is an A TypeScript server agnostic Whatsapp's Official API framework
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via the verifyRequestSignature
due to the failure in validating the message's signature. An attacker can bypass access controls by manipulating the signature verification process.
Workaround
It's possible to check the payload validation using the WhatsAppAPI.verifyRequestSignature
and expect false when the signature is valid.
function doPost(payload, header_signature) {
if (whatsapp.verifyRequestSignature(payload.toString(), header_signature) {
throw 403;
}
// Now the payload is correctly verified
whatsapp.post(payload);
}