Moderate severityNVD Advisory· Published Sep 12, 2024· Updated Sep 12, 2024
whatsapp-api-js fails to validate message's signature
CVE-2024-45607
Description
whatsapp-api-js is a TypeScript server agnostic Whatsapp's Official API framework. It's possible to check the payload validation using the WhatsAppAPI.verifyRequestSignature and expect false when the signature is valid. Incorrect Access Control, anyone using the post or verifyRequestSignature methods to handle messages is impacted. This vulnerability is fixed in 4.0.3.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
whatsapp-api-jsnpm | >= 4.0.0, < 4.0.3 | 4.0.3 |
Affected products
1- Range: >= 4.0.0, < 4.0.3
Patches
156620c651264Merge pull request #371 from felixarjuna/fix-verify-signature-double-negation
2 files changed · +6 −2
src/index.ts+1 −1 modified@@ -976,7 +976,7 @@ export class WhatsAppAPI<EmittersReturnType = void> { .map((b) => b.toString(16).padStart(2, "0")) .join(""); - return signature !== check; + return signature === check; } /**
test/index.test.cjs+5 −1 modified@@ -1629,7 +1629,11 @@ describe("WhatsAppAPI", function () { it("should throw 401 if the signature doesn't match the hash", async function () { await rejects( - Whatsapp.post(valid_message_mock, body, "wrong"), + Whatsapp.post( + valid_message_mock, + body, + "sha256=wrong" + ), threw(401) ); });
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-mwhf-vhr5-7j23ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-45607ghsaADVISORY
- github.com/Secreto31126/whatsapp-api-js/commit/56620c65126427496a94d176082fbd8393a95b6dghsax_refsource_MISCWEB
- github.com/Secreto31126/whatsapp-api-js/pull/371ghsax_refsource_MISCWEB
- github.com/Secreto31126/whatsapp-api-js/security/advisories/GHSA-mwhf-vhr5-7j23ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.