Skip to content

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

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

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

Conversation

@danielalfarourrea

Copy link
Copy Markdown
Contributor

Problem

WebhookSignatureValidator.validate was calling .downcase on data_id 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 .downcase call in build_manifest so the value is included exactly as received.

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 data_id 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