Skip to content

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

Merged
luismeli10 (luismeli10) merged 2 commits into
masterfrom
feature/fix-wh-signature
Jun 24, 2026
Merged

fix(webhook): preserve data.id case in signature manifest#118
luismeli10 (luismeli10) merged 2 commits into
masterfrom
feature/fix-wh-signature

Conversation

@danielalfarourrea

Copy link
Copy Markdown
Contributor

Problem

The WebhookSignatureValidator was calling .lower() 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 .lower() call in _build_manifest so the value is included exactly as received. The docstring 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 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.
@luismeli10 luismeli10 (luismeli10) merged commit 939f9ce into master Jun 24, 2026
0 of 3 checks passed
@luismeli10 luismeli10 (luismeli10) deleted the feature/fix-wh-signature branch June 24, 2026 01:41
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.

2 participants