Advisory

GHSA-mwhf-vhr5-7j23

Also known as: CVE-2024-45607

Summary

whatsapp-api-js fails to validate message's signature

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-09-12 21:29 UTC
Modified
2024-09-12 21:58 UTC

Affected packages and fixes

whatsapp-api-js

npm · All systems

Affected

  • introduced 4.0.0, fixed 4.0.3 (semver)

Fixed versions

4.0.3

Fix

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

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences