CVE-2024-45607
JSON

5.8medium

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

Severity
5.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
14.5% (higher than 96% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mwhf-vhr5-7j23

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

Product or packageVersionsReported by
Secreto31126 whatsapp-api-js>= 4.0.0, < 4.0.3, from 4.0.0 before 4.0.3CVE List, NVD
whatsapp-api-js (npm)from 4.0.0 before 4.0.3GitHub Advisory Database

All scores

GitHub_M5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
GitHub5.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-347

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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

NVD (es)

whatsapp-api-js es un framework API oficial de WhatsApp independiente del servidor TypeScript. Es posible comprobar la validación del payload mediante WhatsAppAPI.verifyRequestSignature y esperar un resultado falso cuando la firma es válida. Control de acceso incorrecto: cualquiera que utilice los métodos post o verifiedRequestSignature para gestionar mensajes se ve afectado. Esta vulnerabilidad se corrigió en la versión 4.0.3.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-45607 changed 2024-09-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-mwhf-vhr5-7j23 changed 2024-09-12CC-BY-4.0
NVDCVE-2024-45607 changed 2026-06-17Public domain