# CVE-2021-44878: Pac4j token validation bypass if OpenID Connect provider supports none algorithm

> Attackers can bypass OpenID Connect token validation by using the 'none' algorithm, allowing unauthorized access if the library is not explicitly configured to reject it.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Jan 2022
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-xhw6-hjc9-679m

## What is CVE-2021-44878?

CVE-2021-44878 is a high-severity authentication bypass vulnerability in n/a, published on 6 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

If an OpenID Connect provider supports the "none" algorithm (i.e., tokens with no signature), pac4j v5.3.0 (and prior) does not refuse it without an explicit configuration on its side or for the "idtoken" response type which is not secure and violates the OpenID Core Specification. The "none" algorithm does not require any signature verification when validating the ID tokens, which allows the attacker to bypass the token validation by injecting a malformed ID token using "none" as the value of "alg" key in the header with an empty signature value.

Weakness: CWE-347 (Improper Verification of Cryptographic Signature)

## Which versions are affected by CVE-2021-44878?

4 open source packages ship an affected version, including org.pac4j:pac4j-oidc. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.pac4j:pac4j-oidc` | Maven | All versions | 4.5.5 |
| `org.pac4j:pac4j-oidc` | Maven | All versions | 4.5.5 |
| `org.pac4j:pac4j-oidc` | Maven | From 5.0 | 5.3.1 |
| `org.pac4j:pac4j-oidc` | Maven | From 5.0 | 5.3.1 |

Products: Pac4j Pac4j.

## How do I fix CVE-2021-44878?

Upgrade org.pac4j:pac4j-oidc to a fixed version for your release line: 4.5.5 or 5.3.1.

## Is CVE-2021-44878 being exploited?

There is no known exploitation of CVE-2021-44878 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2026-40459](https://insights.sbomify.com/CVE-2026-40459/): LDAP Injection in PAC4J (high 8.7)
- [CVE-2026-40458](https://insights.sbomify.com/CVE-2026-40458/): Cross-Site Request Forgery in PAC4J (high 7.0)
- [CVE-2019-10755](https://insights.sbomify.com/CVE-2019-10755/): Use of Cryptographically Weak Pseudo-Random Number Generator in org.pac4j:pac4j-saml (medium 4.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-44878 and fix it if it is affected.

What it is: CVE-2021-44878 is a high-severity authentication bypass vulnerability in n/a, published on 6 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-44878 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.pac4j:pac4j-oidc (Maven): affected all versions; fixed in 4.5.5
- org.pac4j:pac4j-oidc (Maven): affected all versions; fixed in 4.5.5
- org.pac4j:pac4j-oidc (Maven): affected from 5.0; fixed in 5.3.1
- org.pac4j:pac4j-oidc (Maven): affected from 5.0; fixed in 5.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-44878/ (Markdown: https://insights.sbomify.com/CVE-2021-44878/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-44878
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-44878
- OSV: https://osv.dev/vulnerability/CVE-2021-44878

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-44878/
Summaries are generated and may contain mistakes; the official description above is the record.
