CVE-2024-23647: Goauthentik.io Authentik Vulnerable To PKCE Downgrade Vulnerability

HIGH
Advisory Identifier: GHSA-mrx3-gxjx-hjqj
CVSS 6.5
CWE-287
Published
Advisory Summary

CVE-2024-23647 is a HIGH (CVSS 6.5) authentik vulnerable to pkce downgrade vulnerability (CWE-287: Improper Authentication) affecting Goauthentik.io libraries in the Go ecosystem. The issue involves authentik vulnerable to pkce downgrade attack. Remediation is available by upgrading affected packages to version 2023.10.7, 2023.8.7.

CVE-2024-23647 at a Glance

CVE Identifier CVE-2024-23647
GHSA Identifier GHSA-mrx3-gxjx-hjqj
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-287: Improper Authentication
Affected Product Goauthentik.io
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.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:R/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 Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-23647

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

goauthentik.io fixed: 2023.10.7
Upgrade goauthentik.io to 2023.10.7
goauthentik.io fixed: 2023.8.7
Upgrade goauthentik.io to 2023.8.7
Verify Direct and Transitive Dependencies

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

inspect dependencies for goauthentik.io

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-23647, inspect your project dependencies for Goauthentik.io:

inspect dependencies for goauthentik.io

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Goauthentik.io, 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

## Summary PKCE is a very important countermeasure in OAuth2 , both for public and confidential clients. It protects against CSRF attacks and code injection attacks. Because of this bug, an attacker can circumvent the protection PKCE offers. ## Patches authentik 2023.8.7 and 2023.10.7 fix this issue. ## Details There is a bug in our implementation of PKCE that allows an attacker to circumvent the protection that PKCE offers. PKCE adds the `code_challenge’ parameter to the authorization request and adds the `code_verifier’ parameter to the token request. We recently fixed a downgrade attack (in v2023.8.5 and 2023.10.4) where if the attacker removed the `code_verifier’ parameter in the token request, authentik would allow the request to pass, thus circumventing PKCE’s protection. However, in the latest version of the software, another downgrade scenario is still possible: if the attacker removes the `code_challenge’ parameter from the authorization request, authentik will also not do the PKCE check. Note that this type of downgrade enables an attacker to perform a code injection attack, even if the OAuth client is using PKCE (which is supposed to protect against code injection attacks). To start the attack, the attacker must initiate the authorization process without that `code_challenge’ parameter in the authorization request. But this is easy to do (just use a phishing site or email to trick the user into clicking on a link that the attacker controls – the authorization link without that `code_challenge’ parameter). The OAuth BCP (https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics) explicitly mentions this particular attack in section 2.1.1: “Authorization servers MUST mitigate PKCE Downgrade Attacks by ensuring that a token request containing a code_verifier parameter is accepted only if a code_challenge parameter was present in the authorization request, see Section 4.8.2 for details.” ## For more information If you have any questions or comments about this advisory: - Email us at [security@goauthentik.io](mailto:security@goauthentik.io)

CVE-2024-23647 Affected Goauthentik.io Versions

2 component(s)
Fixed Versions:
2023.10.72023.8.7
Product / Package Ecosystem Affected Versions Fixed Version
goauthentik.io
Go
≥ 2023.10.0
< 2023.10.7
2023.10.7
goauthentik.io
Go
< 2023.8.7
2023.8.7

References

Frequently Asked Questions

What is CVE-2024-23647?
CVE-2024-23647 is a security vulnerability in Goauthentik.io involving Authentik vulnerable to PKCE downgrade attack under CWE-287: Improper Authentication.
Which Goauthentik.io versions are affected?
Affected versions include releases prior to 2023.10.7, 2023.8.7 across affected packages: goauthentik.io.
What version fixes CVE-2024-23647?
Upgrading to 2023.10.7, 2023.8.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is goauthentik.io affected?
Yes, goauthentik.io is affected in releases prior to 2023.10.7, 2023.8.7. Upgrade your dependency to 2023.10.7, 2023.8.7 or later.
What is the CVSS score of CVE-2024-23647?
CVE-2024-23647 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2024-23647?
CVE-2024-23647 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2024-23647?
Run the dependency tree command: 'inspect dependencies for goauthentik.io'. 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-mrx3-gxjx-hjqj",
  "modified" : "2024-11-18T16:26:35Z",
  "published" : "2024-01-29T22:30:54Z",
  "aliases" : [ "CVE-2024-23647" ],
  "summary" : "Authentik vulnerable to PKCE downgrade attack",
  "details" : "## Summary\n\nPKCE is a very important countermeasure in OAuth2 , both for public and confidential clients. It protects against CSRF attacks and code injection attacks. Because of this bug, an attacker can circumvent the protection PKCE offers.\n\n## Patches\n\nauthentik 2023.8.7 and 2023.10.7 fix this issue.\n\n## Details\n\nThere is a bug in our implementation of PKCE that allows an attacker to circumvent the protection that PKCE offers. PKCE adds the `code_challenge’ parameter to the authorization request and adds the `code_verifier’ parameter to the token request. We recently fixed a downgrade attack (in v2023.8.5 and 2023.10.4) where if the attacker removed the `code_verifier’ parameter in the token request, authentik would allow the request to pass, thus circumventing PKCE’s protection. However, in the latest version of the software, another downgrade scenario is still possible: if the attacker removes the `code_challenge’ parameter from the authorization request, authentik will also not do the PKCE check.\n\nNote that this type of downgrade enables an attacker to perform a code injection attack, even if the OAuth client is using PKCE (which is supposed to protect against code injection attacks). To start the attack, the attacker must initiate the authorization process without that `code_challenge’ parameter in the authorization request. But this is easy to do (just use a phishing site or email to trick the user into clicking on a link that the attacker controls – the authorization link without that `code_challenge’ parameter).\n\nThe OAuth BCP (https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics) explicitly mentions this particular attack in section 2.1.1: “Authorization servers MUST mitigate PKCE Downgrade Attacks by ensuring that a token request containing a code_verifier parameter is accepted only if a code_challenge parameter was present in the authorization request, see Section 4.8.2 for details.”\n\n## For more information\n\nIf you have any questions or comments about this advisory:\n\n-   Email us at [security@goauthentik.io](mailto:security@goauthentik.io)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "goauthentik.io"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2023.10.0"
      }, {
        "fixed" : "2023.10.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2023.10.6"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "goauthentik.io"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2023.8.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2023.8.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/goauthentik/authentik/security/advisories/GHSA-mrx3-gxjx-hjqj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-23647"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/goauthentik/authentik/commit/38e04ae12720e5d81b4f7ac77997eb8d1275d31a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goauthentik/authentik"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-29T22:30:54Z",
    "nvd_published_at" : "2024-01-30T17:15:10Z"
  }
}