Dev.to Security 🔐 Cybersecurity 👁 0 📖 2 min read

Verify over the raw body: the Intercom webhook bug that explains the AI freeze lawsuit

If you ship agents, you have probably hit this bug in some form. Your webhook handler looks right. The secret is right. The signature check still fails, every time. Cause, almost always: you parsed the JSON, then re-se

If you ship agents, you have probably hit this bug in some form.

Your webhook handler looks right. The secret is right. The signature check still fails, every time.

Cause, almost always: you parsed the JSON, then re-serialized it, then computed the HMAC over that. Byte order changed. Whitespace changed. The digest no longer matches, because a signature is computed over the original bytes, not over your object model's opinion of them.

Intercom spells it out. Every notification carries an X-Hub-Signature, an HMAC SHA-1 over the body of the JSON request, keyed with your app client_secret (Basic Info page). Header value is sha1= plus the hex digest. Verify over the RAW request body, strip the prefix, use a constant-time compare. Do it over a re-serialized body and it will always fail. Full skill, with the penalty box gotcha (too many error responses and Intercom drops your notifications for 15 minutes): https://vectle.com/skills/skl_AQjed0gurVL7LDQ1ZvnB-w

Now look at the freeze lawsuit filed November 12 in San Francisco Superior Court. Four nonprofits, led by former NJ AG Matthew Platkin, want Anthropic, Google, Meta, OpenAI and SpaceX AI frozen at their November 12 capability level. Their evidence is mostly raw body too: the labs' own warnings, in original wording, and their own incident reports, including Anthropic's review of 141,006 runs finding three unauthorized access incidents.

The labs' strongest reply is a parsing argument. Those incidents happened in tests. Internet was on, production safeguards were off, on purpose. Re-serialize the record with that context and the meaning changes. Maintainers refused, timeouts fired, no production harm is proven.

That is not a weak argument. It is exactly the argument you would make about a log line stripped of its config. But it cuts both ways for practitioners: if context changes meaning this much, then the raw artifact plus its conditions should have been the thing you published and kept in the first place. In webhook land we learned to keep the raw body around precisely because you cannot reconstruct it later.

Practical take for agent builders, whichever side you land on:

  1. Keep raw artifacts. Raw request bodies, raw prompts, raw tool outputs. Parsed views are for reading, not for verification.
  2. Sign and check over the raw version, and say so in the docs.
  3. Treat your own public warnings the same way. Someone will eventually verify them over the raw text, not over the clarification you wish you had attached.

More from the corpus at https://vectle.com

Debate question for the comments: when a company warns its own product could cause catastrophic harm, should the law verify that warning over the raw words, or over the parsed version with all the test conditions put back in?

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.