gist.github.com
OAuth 2.0 and the Road to Hell
All the hard fought compromises on the mailing list, in meetings, in special design committees, and in back channels resulted in a specification that fails to deliver its two main goals – security and interoperability. In fact, one of the compromises was to rename it from a protocol to a framework, and another to add a disclaimer that warns that the specification is unlike to produce interoperable implementations. When compared with OAuth 1.0, the 2.0 specification is more complex, less interoperable, less useful, more incomplete, and most importantly, less secure. To be clear, OAuth 2.0 at the hand of a developer with deep understanding of web security will likely result is a secure implementation. However, at the hands of most developers – as has been the experience from the past two years – 2.0 is likely to produce insecure implementations. … The resulting specification is a **designed-by-committee** patchwork of compromises that serves mostly the enterprise. To be accurate, it doesn’t actually give the enterprise all of what they asked for directly, but it does provide for practically unlimited extensibility. It is this extensibility and required flexibility that destroyed the protocol. **With very little effort, pretty much anything can be called OAuth 2.0 compliant.** … - **Unbounded tokens** – In 1.0, the client has to present two sets of credentials on each protected resource request, the token credentials and the client credentials. In 2.0, the client credentials are no longer used. This means that tokens are no longer bound to any particular client type or instance. This has introduced limits on the usefulness of access tokens as a form of authentication and increased the likelihood of security issues. - **Bearer tokens** – 2.0 got rid of all signatures and cryptography at the protocol level. Instead it relies solely on TLS. This means that 2.0 tokens are inherently less secure as specified. Any improvement in token security requires additional specifications and as the current proposals demonstrate, the group is solely focused on enterprise use cases. - **Expiring tokens** – 2.0 tokens can expire and must be refreshed. This is the most significant change for client developers from 1.0 as they now need to implement token state management. The reason for token expiration is to accommodate self-encoded tokens – encrypted tokens which can be authenticated by the server without a database look-up. Because such tokens are self-encoded, they cannot be revoked and therefore must be short-lived to reduce their exposure. Whatever is gained from the removal of the signature is lost twice in the introduction of the token state management requirement. … On the other hand, 2.0 defines 4 new registries for extensions, along with additional extension points via URIs. The result is a flood of proposed extensions. But the real issues is that the working group could not define the real security properties of the protocol. This is clearly reflected in the security consideration section which is largely an exercise of hand waving. It is barely useful to security experts as a bullet point of things to pay attention to.
Related Pain Points3件
Bearer tokens lack cryptographic binding and signature
8OAuth 2.0 removed signature-based security in favor of relying solely on TLS. Bearer tokens are not cryptographically bound to clients, making them inherently less secure if TLS is compromised.
Overwhelming OAuth 2.0 RFC complexity and fragmentation
7OAuth 2.0 is defined across 17 different RFCs covering OAuth framework, Bearer tokens, threat models, and private key JWTs. Developers must navigate this massive standard even for simple third-party-access use cases, and no two API providers implement the same subset consistently.
Token state management burden replaces signature removal benefits
7OAuth 2.0 introduced token expiration and refresh requirements to support self-encoded tokens, shifting complexity to developers. The state management burden outweighs security gains from removing signatures.