Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I Found a postMessage Origin Bypass in an OAuth SDK

I spend a lot of time reading other people's code. Not because I enjoy it—though honestly, I kind of do—but because that's where the interesting bugs live. Not the flashy ones that get all the attention on Twitter. The quiet ones. The ones hiding in plain sight, inside a single missing if statement. This is the story of one of those bugs. The Backstory A few weeks ago I was doing a security…

A security researcher discovered a vulnerability in an OAuth SDK used by a web3 project. The issue arose from an OAuth popup that communicated with the main application window using the `postMessage` API. This communication lacked an origin check, allowing attackers to spoof messages from the legitimate OAuth popup. The SDK generated message IDs sequentially, making it easy for attackers to predict the next ID and send malicious messages.

The researcher reported the issue, and the fix was as simple as adding an origin check to the message event listener. This story highlights the importance of validating `event.origin`, using unpredictable IDs, and maintaining consistency in security practices across codebases.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How I Mapped an Undocumented Vendor API in 2 Days With Claude Code

TL;DR A vendor handed us a sandbox key, a 6-page PDF, and no OpenAPI spec. I used Claude Code to turn ~40 exploratory requests into an inferred schema, a typed client, and a contract test suite in two…

  • Author mapped undocumented vendor API in 2 days
  • Used Claude Code to trace actual HTTP responses
  • Discovered 31 fields in invoice object vs 6 per PDF

More from Friday 28 August →