GitHub Advisoryadvisory · npm

GHSA-mwhf-vhr5-7j23 whatsapp-api-js fails to validate message's signature

MEDIUM Published 2024-09-12 Modified 2024-09-12 Official page ↗
Aliases
CVE-2024-45607
Ecosystem
npm
Packages
whatsapp-api-js
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
Weaknesses
CWE-347
Reviewed
2024-09-12

Affected packages

• npm whatsapp-api-js: >= 4.0.0, < 4.0.3 → fixed in 4.0.3

Description

Impact Incorrect Access Control, anyone using the post or verifyRequestSignature methods to handle messages is impacted. Patches Patched in version 4.0.3. Workarounds It's possible to check the payload validation using the WhatsAppAPI.verifyRequestSignature and expect false when the signature is valid. ```ts function doPost(payload, header_signature) { if (whatsapp.verifyRequestSignature(payload.toString(), header_signature) { throw 403; } // Now the payload is correctly verified whatsapp.post(payload); } ``` References https://github.com/Secreto31126/whatsapp-api-js/pull/371

Related

Alias · CVE (1)

  • CVE-2024-45607 whatsapp-api-js is a TypeScript server agnostic Whatsapp's Official API framework. vulnerability

Weakness · CWE (1)

  • CWE-347 Improper Verification of Cryptographic Signature weakness

References