SShortSingh.
Back to feed

Why JSON Body Parsers Break Stripe and Shopify Webhook HMAC Signature Checks

0
·4 views

A common cause of 401 Unauthorized errors in Node and TypeScript webhook handlers is checking the HMAC-SHA256 signature against a re-serialized JSON body rather than the original bytes. Once a global JSON parser has deserialized and reserialized a payload, changes in key spacing, escaped characters, or number formatting can yield a different digest. The article provides a sample Stripe verification function that works on the raw UTF-8 body buffer, combines it with the timestamp, and enforces a replay-protection tolerance window. It also uses a constant-time comparison to guard against timing attacks. The piece points to a companion engineering guide and an interactive signature tester for further study.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Entwickler baut iOS-App für Clash-of-Clans-Layouts mit Fokus auf Spielerfilter

A developer has created a free, unofficial iOS app for finding Clash of Clans base layouts, not affiliated with Supercell. The app lets players filter bases by Town Hall level so that lower-level layouts are excluded for higher-level accounts. It separates layouts into modes for war, farming, and Clan War League, and allows a single tap to copy a layout directly into the game. According to the developer, usage data suggests players favor bases with fewer copies, since those are harder for opponents to prepare for.

0
ProgrammingDEV Community ·

Record a short repro for coding agents instead of describing bugs in Slack

The author argues that vague bug descriptions in Slack threads give coding agents too little to work with, leading to patches that miss the actual problem. Instead, they recommend a brief, replayable repro such as numbered steps, a failing URL, a minimal network snippet, a short recording, or the relevant console stack trace. The piece stresses keeping the effort proportionate, so the repro is cheaper than guessing. It also offers a reusable template that captures surface, environment, steps, expected and actual results, and artifacts, along with rules for keeping recordings useful. Slack is positioned for routing and triage, while the agent chat or pull request serves as the artifact layer.

0
ProgrammingDEV Community ·

Friday app shares corrections across coding agents so fixes carry over between tools

Friday is a free, MIT-licensed desktop app that runs coding agents such as Claude Code, Codex and Cursor side by side on a user's computer. After each run, the coding tool reads the session locally and records lessons like decisions, pitfalls, and conventions for that repository. When a user corrects an agent, that correction is passed to every agent that later works in the same repository, regardless of tool. If a mistake recurs, Friday can run a user-approved read-only or test command after changes and returns failures to the agent, and lessons unused for 60 days are retired. All lessons are viewable and editable in Settings under Memory, stored locally per repository, and the author notes the feature is new with no data yet on its effectiveness.