---
author: Jan Brennenstuhl
canonical_url: https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/
description: The attacks that work against OpenID Connect clients and providers, documented by Ruhr-University Bochum, and the checks that prevent them.
id: jb-research-oidc-security
kind: guide
license:
  name: CC BY 4.0
  scope: Original text; credited third-party media retain their own rights.
  url: https://creativecommons.org/licenses/by/4.0/
markdown_url: https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/index.md
modified: '2026-10-13T00:00:00+02:00'
published: '2023-05-15T00:00:00+02:00'
review_basis: ''
review_status: not-reviewed
reviewed: ''
series: ''
status: published
title: Where do OpenID Connect implementations break?
topics:
- identity-authentication
---

# Where do OpenID Connect implementations break?

**Short answer:** Implementations break mostly where tokens and redirects get checked. Documented attacks on relying parties include token substitution, key confusion and replay, and attacks on providers include redirect URI manipulation, PKCE downgrade and sub claim spoofing. Certification doesn't rule these out, as a 2020 lab analysis of OpenID Certified implementations disclosed 12 flaws.


<a id="key-findings"></a>
## Key findings


<a id="f-oidc-certified-12-flaws"></a>
> **Finding f-oidc-certified-12-flaws:** Testing 6 OpenID Certified identity providers and 8 service providers against 11 service provider attacks and 7 identity provider attacks uncovered 12 implementation flaws.
>
> Source: [Fries, Security Analysis of Real-Life OpenID Connect Implementations (Master's thesis, Ruhr-University Bochum, 2020)](https://www.nds.ruhr-uni-bochum.de/media/ei/arbeiten/2021/05/03/masterthesis.pdf)
> Link: https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/#f-oidc-certified-12-flaws



<a id="f-oidc-spec-flaws"></a>
> **Finding f-oidc-spec-flaws:** Mladenov and Mainka classify session overwriting and IdP confusion as flaws in the OpenID Connect specification itself, separate from implementation bugs.
>
> Source: [Mladenov and Mainka, OpenID Connect Security Considerations (Ruhr-University Bochum, 2017)](https://www.nds.ruhr-uni-bochum.de/media/ei/veroeffentlichungen/2017/01/13/OIDCSecurity_1.pdf)
> Link: https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/#f-oidc-spec-flaws



<a id="f-oidc-attacker-needs-no-network"></a>
> **Finding f-oidc-attacker-needs-no-network:** The attacks in the OpenID Connect Security Considerations report work for a web attacker who sends ordinary HTTP requests and has no control over the network.
>
> Source: [Mladenov and Mainka, OpenID Connect Security Considerations (Ruhr-University Bochum, 2017)](https://www.nds.ruhr-uni-bochum.de/media/ei/veroeffentlichungen/2017/01/13/OIDCSecurity_1.pdf)
> Link: https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/#f-oidc-attacker-needs-no-network


<a id="evidence"></a>
## Evidence


**OpenID Connect security studies**

| Study | Year | Sample | Method | Finding |
| --- | --- | --- | --- | --- |
| [Security Analysis of Real-Life OpenID Connect Implementations](https://www.nds.ruhr-uni-bochum.de/media/ei/arbeiten/2021/05/03/masterthesis.pdf) (Ruhr-University Bochum) | 2020 | 6 identity providers, 8 service providers | Docker lab with PrOfESSOS, automatic and manual tests | 18 attack types tested; 12 implementation flaws disclosed. |

| [OpenID Connect Security Considerations](https://www.nds.ruhr-uni-bochum.de/media/ei/veroeffentlichungen/2017/01/13/OIDCSecurity_1.pdf) (Ruhr-University Bochum) | 2017 | n/a | Technical report on specification and implementation flaws | Catalogues attacks on clients and providers with defence recommendations. |


<a id="what-to-do"></a>
## What to do

<a id="for-engineers"></a>
### For engineers

On the relying party:

- Validate every <a class="term" href="https://www.janbrennenstuhl.eu/glossary/#id-token">ID token</a>: signature with a key from the expected issuer's key set, algorithm, issuer, audience, expiry and nonce. Signature manipulation, key confusion, token recipient confusion and replay attacks all exploit a missing check. My essays on [JWKS](https://www.janbrennenstuhl.eu/jwks/) and [the purpose of JWT](https://www.janbrennenstuhl.eu/jwt-stateless-authentication/) cover the token side.
- Bind each login to the browser session that started it, and remember which identity provider you sent the user to. Session overwriting and IdP confusion exploit clients that don't.
- Identify users by issuer and subject together, never by subject or email alone.

On the OpenID provider:

- Compare redirect URIs exactly against the registered values.
- Enforce <a class="term" href="https://www.janbrennenstuhl.eu/glossary/#pkce"><abbr title="Proof Key for Code Exchange">PKCE</abbr></a> for clients that started with it, so an attacker can't downgrade the flow.
- Accept each authorization code once and only from the client it was issued to.

<a id="for-product-and-ux"></a>
### For product and UX

- Treat "OpenID Certified" as a conformance signal, not a security audit. Fries tested certified implementations and still disclosed 12 flaws. When you choose a library or vendor, ask for penetration test results that cover these attack classes.
- If your product offers several identity providers, show users which one they're signing in with. IdP confusion attacks rely on the client mixing them up.

<a id="the-studies-in-detail"></a>
## The studies in detail

<a id="security-analysis-of-real-life-openid-connect-implementations"></a>
### Security Analysis of Real-Life OpenID Connect Implementations

In this Master's thesis from December 2020, Christian Fries presents a Docker-based lab environment for developers and penetration testers. The lab helps to find security flaws in real-world OpenID Connect Certified service provider and identity provider implementations, and it includes the PrOfESSOS tool for automatic tests. Fries selected 6 identity providers and 8 service providers that support the implicit and hybrid flows. He tested them against 11 service provider attacks and 7 identity provider attacks and disclosed 12 implementation flaws to the developers.

The thesis also describes common threats and attack scenarios. These include single- and cross-phase attacks on relying parties, like token substitution, key confusion and replay attacks. It also covers attacks on OpenID providers, like message flow confusion, PKCE downgrade and sub claim spoofing.

[Read the paper (PDF)](https://www.nds.ruhr-uni-bochum.de/media/ei/arbeiten/2021/05/03/masterthesis.pdf)

<a id="openid-connect-security-considerations"></a>
### OpenID Connect Security Considerations

In this 2017 technical report, Vladislav Mladenov and Christian Mainka from Ruhr-University Bochum look at OpenID Connect specification flaws and implementation issues that open up attack vectors. They outline attack scenarios like session overwriting, redirect URI manipulation and token recipient confusion, and give recommendations for defending against them.

[Read the paper (PDF)](https://www.nds.ruhr-uni-bochum.de/media/ei/veroeffentlichungen/2017/01/13/OIDCSecurity_1.pdf)

<a id="related"></a>
## Related

- [Step-up authentication with OpenID Connect](https://www.janbrennenstuhl.eu/step-up-authentication/)
- [How do attackers take over accounts?](https://www.janbrennenstuhl.eu/knowledge-base/account-security/account-takeover/)
- [Glossary](https://www.janbrennenstuhl.eu/glossary/)


---

Cite as: Jan Brennenstuhl. "Where do OpenID Connect implementations break?." Brennenstuhl on Security, 15 May 2023. https://www.janbrennenstuhl.eu/knowledge-base/oidc/openid-connect-security/
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) for the original text; credited third-party media keep their own rights.
