Incorrect Access Control, anyone using the post or verifyRequestSignature methods to handle messages is impacted.
Patched in version 4.0.3.
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);
}
https://github.com/Secreto31126/whatsapp-api-js/pull/371
{ "github_reviewed_at": "2024-09-12T21:29:17Z", "cwe_ids": [ "CWE-347" ], "nvd_published_at": "2024-09-12T20:15:05Z", "severity": "MODERATE", "github_reviewed": true }