CVE-2020-15233: Github.com/ory/fosite OAuth2 Redirect URL Validity Does Vulnerability

MODERATE
Advisory Identifier: GHSA-rfq3-w54c-f9q5
CVSS 6.1
CWE-20 CWE-601
Published
Advisory Summary

CVE-2020-15233 is a MODERATE (CVSS 6.1) oauth2 redirect url validity does vulnerability (CWE-20: Improper Input Validation) affecting Github.com/ory/fosite libraries in the Go ecosystem. The issue involves oauth2 redirect url validity does not respect query parameters and character casing for loopback addresses. Remediation is available by upgrading affected packages to version 0.34.1.

CVE-2020-15233 at a Glance

CVE Identifier CVE-2020-15233
GHSA Identifier GHSA-rfq3-w54c-f9q5
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/ory/fosite
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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

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

How to Fix CVE-2020-15233

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

github.com/ory/fosite fixed: 0.34.1
Upgrade github.com/ory/fosite to 0.34.1
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 github.com/ory/fosite

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-15233, inspect your project dependencies for Github.com/ory/fosite:

inspect dependencies for github.com/ory/fosite

Analyze the terminal output to locate any version of Github.com/ory/fosite in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.34.1), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/ory/fosite, 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

### Impact [fosite#400](https://github.com/ory/fosite/pull/400) (released as v0.30.2) introduced a new feature for handling redirect URLs pointing to loopback interfaces ([rfc8252#section-7.3](https://tools.ietf.org/html/rfc8252#section-7.3)). As part of that change new behavior was introduced which failed to respect the redirect URL's (only for loopback interfaces!) query parameters 1. Registering a client with allowed redirect URL `http://127.0.0.1/callback` 2. Performing OAuth2 flow and requesting redirect URL `http://127.0.0.1/callback?bar=foo` 3. Instead of an error, the browser is redirected to `http://127.0.0.1/callback?bar=foo` with a potentially successful OAuth2 response. as well as the host parameter (as long as the host is a loopback interface): 1. Registering a client with allowed redirect URL `https://example.com/callback` 2. Performing OAuth2 flow and requesting redirect URL `http://127.0.0.1/callback` 3. Instead of an error, the browser is redirected to `http://127.0.0.1/callback` with a potentially successful OAuth2 response. These bugs are only applicable in scenarios where the attacker has control over the loopback interface (`localhost`, `127.0.0.1`, `[::1]`) where the browser performing the OAuth2 flow is running.

CVE-2020-15233 Affected Github.com/ory/fosite Versions

1 component(s)
Fixed Versions:
0.34.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ory/fosite
Go
≥ 0.30.3
< 0.34.1
0.34.1

References

Frequently Asked Questions

What is CVE-2020-15233?
CVE-2020-15233 is a security vulnerability in Github.com/ory/fosite involving OAuth2 Redirect URL validity does not respect query parameters and character casing for loopback addresses under CWE-20: Improper Input Validation.
Which Github.com/ory/fosite versions are affected?
Affected versions include releases prior to 0.34.1 across affected packages: github.com/ory/fosite.
What version fixes CVE-2020-15233?
Upgrading to 0.34.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ory/fosite affected?
Yes, github.com/ory/fosite is affected in releases prior to 0.34.1. Upgrade your dependency to 0.34.1 or later.
What is the CVSS score of CVE-2020-15233?
CVE-2020-15233 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N/E:P/RL:O/RC:C.
What CWE is associated with CVE-2020-15233?
CVE-2020-15233 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2020-15233?
Run the dependency tree command: 'inspect dependencies for github.com/ory/fosite'. 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-rfq3-w54c-f9q5",
  "modified" : "2021-11-19T14:42:56Z",
  "published" : "2021-05-24T17:00:12Z",
  "aliases" : [ "CVE-2020-15233" ],
  "summary" : "OAuth2 Redirect URL validity does not respect query parameters and character casing for loopback addresses",
  "details" : "### Impact\n\n[fosite#400](https://github.com/ory/fosite/pull/400) (released as v0.30.2) introduced a new feature for handling redirect URLs pointing to loopback interfaces ([rfc8252#section-7.3](https://tools.ietf.org/html/rfc8252#section-7.3)). As part of that change new behavior was introduced which failed to respect the redirect URL's (only for loopback interfaces!) query parameters\n\n1. Registering a client with allowed redirect URL `http://127.0.0.1/callback`\n2. Performing OAuth2 flow and requesting redirect URL `http://127.0.0.1/callback?bar=foo`\n3. Instead of an error, the browser is redirected to `http://127.0.0.1/callback?bar=foo` with a potentially successful OAuth2 response.\n\nas well as the host parameter (as long as the host is a loopback interface):\n\n1. Registering a client with allowed redirect URL `https://example.com/callback`\n2. Performing OAuth2 flow and requesting redirect URL `http://127.0.0.1/callback`\n3. Instead of an error, the browser is redirected to `http://127.0.0.1/callback` with a potentially successful OAuth2 response.\n\nThese bugs are only applicable in scenarios where the attacker has control over the loopback interface (`localhost`, `127.0.0.1`, `[::1]`) where the browser performing the OAuth2 flow is running.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N/E:P/RL:O/RC:C"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ory/fosite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.30.3"
      }, {
        "fixed" : "0.34.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ory/fosite/security/advisories/GHSA-rfq3-w54c-f9q5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15233"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ory/fosite/pull/400"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ory/fosite/commit/cdee51ebe721bfc8acca0fd0b86b030ca70867bf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ory/fosite"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T22:14:38Z",
    "nvd_published_at" : "2020-10-02T21:15:00Z"
  }
}