Lucene search

K
githubGitHub Advisory DatabaseGHSA-MWHF-VHR5-7J23
HistorySep 12, 2024 - 9:29 p.m.

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

2024-09-1221:29:17
CWE-347
GitHub Advisory Database
github.com
7
whatsapp-api-js
message signature
vulnerability
patch
version 4.0.3

CVSS3

5.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

NONE

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N

AI Score

6.8

Confidence

High

EPSS

0.001

Percentile

21.3%

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

Affected configurations

Vulners
Node
secreto31126whatsapp_api_jsRange<4.0.3
VendorProductVersionCPE
secreto31126whatsapp_api_js*cpe:2.3:a:secreto31126:whatsapp_api_js:*:*:*:*:*:*:*:*

CVSS3

5.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

NONE

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N

AI Score

6.8

Confidence

High

EPSS

0.001

Percentile

21.3%

Related for GHSA-MWHF-VHR5-7J23