Improper Verification of Cryptographic Signature Affecting whatsapp-api-js package, versions >=4.0.0 <4.0.3


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (23rd percentile)

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 IDSNYK-JS-WHATSAPPAPIJS-7945494
  • published13 Sept 2024
  • disclosed12 Sept 2024
  • creditFelix Arjuna

Introduced: 12 Sep 2024

CVE-2024-45607  (opens in a new tab)
CWE-347  (opens in a new tab)

How 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);

}

CVSS Scores

version 4.0
version 3.1