{"id":"GHSA-mwhf-vhr5-7j23","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","aliases":["CVE-2024-45607"],"modified":"2024-09-12T21:58:08.792359Z","published":"2024-09-12T21:29:17Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2024-09-12T21:29:17Z","nvd_published_at":"2024-09-12T20:15:05Z","cwe_ids":["CWE-347"],"severity":"MODERATE"},"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"}],"affected":[{"package":{"name":"whatsapp-api-js","ecosystem":"npm","purl":"pkg:npm/whatsapp-api-js"},"ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.0.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-mwhf-vhr5-7j23/GHSA-mwhf-vhr5-7j23.json"}}],"schema_version":"1.9.0","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"}]}