Vulnerabilities in pkg:maven/org.pac4j/pac4j-oidc

PACKAGE
Advisory Identifier: GHSA-xhw6-hjc9-679m
Advisory Summary

CVE-2021-44878 is a HIGH (CVSS 7.5) pac4j token validation bypass if vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Pac4j oidc libraries in the Maven ecosystem. The issue involves pac4j token validation bypass if openid connect provider supports none algorithm. Remediation is available by upgrading affected packages to version 4.5.5, 5.3.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.pac4j/pac4j-oidc

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.pac4j/pac4j-oidc. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xhw6-hjc9-679m CVE-2021-44878 HIGH Pac4j token validation bypass if OpenID Connect provider supports none algorithm

CVE-2021-44878 at a Glance

CVE Identifier CVE-2021-44878
GHSA Identifier GHSA-xhw6-hjc9-679m
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Pac4j oidc
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-44878

To remediate this vulnerability, upgrade all affected Pac4j oidc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.pac4j:pac4j-oidc fixed: 4.5.5
<dependency>
    <groupId>org.pac4j</groupId>
    <artifactId>pac4j-oidc</artifactId>
    <version>4.5.5</version>
</dependency>
org.pac4j:pac4j-oidc fixed: 5.3.1
<dependency>
    <groupId>org.pac4j</groupId>
    <artifactId>pac4j-oidc</artifactId>
    <version>5.3.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.pac4j

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-44878, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.pac4j

Analyze the terminal output to locate any version of Pac4j oidc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.5), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.pac4j command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Pac4j oidc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2021-44878 Affected Pac4j oidc Versions

2 component(s)
Fixed Versions:
4.5.55.3.1
Product / Package Ecosystem Affected Versions Fixed Version
org.pac4j:pac4j-oidc
Maven
< 4.5.5
4.5.5
org.pac4j:pac4j-oidc
Maven
≥ 5.0
< 5.3.1
5.3.1

References

Frequently Asked Questions

What is CVE-2021-44878?
CVE-2021-44878 is a security vulnerability in Pac4j oidc involving Pac4j token validation bypass if OpenID Connect provider supports none algorithm under CWE-347: Improper Verification of Cryptographic Signature.
Which Pac4j oidc versions are affected?
Affected versions include releases prior to 4.5.5, 5.3.1 across affected packages: org.pac4j:pac4j-oidc.
What version fixes CVE-2021-44878?
Upgrading to 4.5.5, 5.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pac4j-oidc affected?
Yes, org.pac4j:pac4j-oidc is affected in releases prior to 4.5.5, 5.3.1. Upgrade your dependency to 4.5.5, 5.3.1 or later.
What is the CVSS score of CVE-2021-44878?
CVE-2021-44878 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2021-44878?
CVE-2021-44878 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check Maven dependencies for CVE-2021-44878?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.pac4j'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xhw6-hjc9-679m",
  "modified" : "2023-09-26T17:27:45Z",
  "published" : "2022-01-08T00:36:05Z",
  "aliases" : [ "CVE-2021-44878" ],
  "summary" : "Pac4j token validation bypass if OpenID Connect provider supports none algorithm",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.pac4j:pac4j-oidc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.pac4j:pac4j-oidc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0"
      }, {
        "fixed" : "5.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-44878"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pac4j/pac4j/commit/09684e0de1c4753d22c53b8135d4ef61cfda76f7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pac4j/pac4j/commit/22b82ffd702a132d9f09da60362fc6264fc281ae"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pac4j/pac4j/commit/9c87bbc536ed5d05f940ae015403120df2935589"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pac4j/pac4j"
  }, {
    "type" : "WEB",
    "url" : "https://openid.net/specs/openid-connect-core-1_0.html#IDToken"
  }, {
    "type" : "WEB",
    "url" : "https://www.pac4j.org/4.5.x/docs/release-notes.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.pac4j.org/blog/cve_2021_44878_is_this_serious.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-07T22:41:34Z",
    "nvd_published_at" : "2022-01-06T13:15:00Z"
  }
}