Why it matters
InitData is HMAC-signed with the bot token; skipping validation forges user identity.
Practical steps
- Parse the initData query string carefully
- Verify HMAC-SHA256 per Telegram's algorithm
- Reject stale auth_date values
- Create a server session only after verify
- Keep the bot token off the Mini App frontend
Watch out for
- Copy-pasting outdated snippets for telegram webapp initdata without re-reading current official docs.
- Shipping telegram webapp initdata to production without a staging rehearsal and a documented rollback.