Skip to content

v1.3.1

Choose a tag to compare

@solvejet-team solvejet-team released this 20 Nov 19:11
· 12 commits to master since this release
1793f8d

Security hardening for webhook verification and parsing, plus type and documentation fixes.

Security

  • Webhook verification now fails closed: verifySignature returns false for an empty or non-string secret (previously an empty key could produce a valid-looking check), and verifyWebhook/verifyWebhookQuery return 403 for an empty verify token.
  • The WebhookHandler constructor throws WhatsAppWebhookError when appSecret or verifyToken is present but undefined or empty, so an unset environment variable no longer silently disables verification. Omitting the appSecret key entirely still means no signature enforcement.
  • WebhookHandler.parse and parseWebhook reject bodies over 3 MiB (Meta's documented maximum) before parsing; configure with maxBodyBytes.
  • JSON parse errors no longer carry a fragment of the request body as cause.
  • Trailing slashes of baseUrl are trimmed in linear time (fixes a CodeQL polynomial-ReDoS finding).

Fixed

  • Byte bodies: Uint8Array, Buffer and ArrayBuffer now verify and parse.
  • Extractors no longer throw on very large arrays (RangeError near 125k elements) or on malformed shapes.
  • Examples and README now parse before responding, return text/plain for the verification challenge, and return 401 only for a bad signature.

Behavior change

  • extractMessages and extractStatuses read only the messages webhook field. Call status events from the calls field are no longer returned as message statuses; read them from parsed.raw.

Types

  • Optional additions only: played status, biz_opaque_callback_data, pricing.type/subtype, Click to WhatsApp referral, message context flags, and more. See the CHANGELOG.

Zero runtime dependencies. Requires Node.js 20+.