whatsapp-api-js
Affected
- introduced
4.0.0, fixed4.0.3(semver)
Fixed versions
4.0.3
Fix
- Fixed version
4.0.3npm install [email protected]
Advisory
Also known as: CVE-2024-45607
whatsapp-api-js fails to validate message's signature
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.
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
Medium Basis: The source's own band: MODERATE
4.0.0, fixed 4.0.3 (semver)4.0.3
4.0.3npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0