How I Found an SSRF in an AI SDK's OAuth Metadata Discovery
Some bugs announce themselves. You're reading through a codebase and the vulnerability practically waves at you from the screen. This was not one of those bugs. This one required me to ask a question that I almost didn't ask. And that question led down a rabbit hole that ended with a server-side request forgery in a fairly popular AI SDK. The Context I've been doing security reviews of AI-related…
An SSRF (Server-Side Request Forgery) vulnerability was discovered in a popular AI SDK's OAuth metadata discovery process. The issue arose from insufficient validation in one part of the authentication flow, while another part contained proper validation. The SDK fetched OAuth metadata by making requests to a server URL provided by the developer.
If an attacker could control this server URL, they could make the SDK fetch internal addresses, potentially leading to credential theft or internal reconnaissance. The vulnerability existed due to the missing validation on the metadata discovery path and the redirect-follow behavior in the fetch function. The fix required adding URL validation to the metadata discovery path and addressing the redirect-follow behavior.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.