Skip to content

fix(webhook): preserve data.id case in signature manifest#372

Open
danielalfarourrea wants to merge 2 commits into
masterfrom
feature/fix-wh-signature
Open

fix(webhook): preserve data.id case in signature manifest#372
danielalfarourrea wants to merge 2 commits into
masterfrom
feature/fix-wh-signature

Conversation

@danielalfarourrea

Copy link
Copy Markdown
Contributor

Problem

WebhookSignatureValidator.validate was calling .toLowerCase() on dataId before building the HMAC manifest. MercadoPago signs webhook notifications using the original casing of data.id, so any notification with uppercase or mixed-case identifiers would fail validation with SignatureMismatch.

Fix

Remove the .toLowerCase() call in buildManifest so the value is included exactly as received. The Javadoc is updated accordingly.

Testing

Verified manually with data.id values in uppercase (ORDER123), lowercase (order123), and mixed case (oRdEr) — all pass when the signature was generated with the same casing.

The manifest was lowercasing dataId before computing the HMAC, but
MercadoPago signs the notification using the original casing. This caused
signature validation to fail whenever data.id contained uppercase letters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant