GHSA-vhxv-fg4m-p2w8: Github.com/jub0bs/cors Some CORS Middleware Allow Untrusted Vulnerability

CRITICAL
CVSS 9.3
Published
Advisory Summary

GHSA-vhxv-fg4m-p2w8 is a CRITICAL (CVSS 9.3) some cors middleware allow untrusted vulnerability (General Security Weakness) affecting Github.com/jub0bs/cors libraries in the Go ecosystem. The issue involves some cors middleware allow untrusted origins. Remediation is available by upgrading affected packages to version 0.1.3.

GHSA-vhxv-fg4m-p2w8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vhxv-fg4m-p2w8
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification General Security Weakness
Affected Product Github.com/jub0bs/cors
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.3

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:C/C:H/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 Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-vhxv-fg4m-p2w8

To remediate this vulnerability, upgrade all affected Github.com/jub0bs/cors 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/jub0bs/cors fixed: 0.1.3
Upgrade github.com/jub0bs/cors to 0.1.3
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/jub0bs/cors

How to Check if You Are Affected

To determine whether your application is affected by GHSA-vhxv-fg4m-p2w8, inspect your project dependencies for Github.com/jub0bs/cors:

inspect dependencies for github.com/jub0bs/cors

Analyze the terminal output to locate any version of Github.com/jub0bs/cors in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.3), 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 General Security Weakness. In Github.com/jub0bs/cors, 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 Some CORS middleware (more specifically those created by specifying two or more origin patterns whose hosts share a proper suffix) incorrectly allow some untrusted origins, thereby opening the door to cross-origin attacks from the untrusted origins in question. For example, specifying origin patterns `https://foo.com` and `https://bar.com` (in that order) would yield a middleware that would incorrectly allow untrusted origin `https://barfoo.com`. ### Patches Patched in v0.1.3. ### Workarounds None.

GHSA-vhxv-fg4m-p2w8 Affected Github.com/jub0bs/cors Versions

1 component(s)
Fixed Versions:
0.1.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/jub0bs/cors
Go
< 0.1.3
0.1.3

References

Frequently Asked Questions

What is GHSA-vhxv-fg4m-p2w8?
GHSA-vhxv-fg4m-p2w8 is a security vulnerability in Github.com/jub0bs/cors involving Some CORS middleware allow untrusted origins under General Security Weakness.
Which Github.com/jub0bs/cors versions are affected?
Affected versions include releases prior to 0.1.3 across affected packages: github.com/jub0bs/cors.
What version fixes GHSA-vhxv-fg4m-p2w8?
Upgrading to 0.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/jub0bs/cors affected?
Yes, github.com/jub0bs/cors is affected in releases prior to 0.1.3. Upgrade your dependency to 0.1.3 or later.
What is the CVSS score of GHSA-vhxv-fg4m-p2w8?
GHSA-vhxv-fg4m-p2w8 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with GHSA-vhxv-fg4m-p2w8?
GHSA-vhxv-fg4m-p2w8 is classified under General Security Weakness.
How can I check Go dependencies for GHSA-vhxv-fg4m-p2w8?
Run the dependency tree command: 'inspect dependencies for github.com/jub0bs/cors'. 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-vhxv-fg4m-p2w8",
  "modified" : "2024-05-21T15:38:55Z",
  "published" : "2024-05-03T17:34:17Z",
  "aliases" : [ ],
  "summary" : "Some CORS middleware allow untrusted origins",
  "details" : "### Impact\n\nSome CORS middleware (more specifically those created by specifying two or more origin patterns whose hosts share a proper suffix) incorrectly allow some untrusted origins, thereby opening the door to cross-origin attacks from the untrusted origins in question.\n\nFor example, specifying origin patterns `https://foo.com` and `https://bar.com` (in that order) would yield a middleware that would incorrectly allow untrusted origin `https://barfoo.com`.\n\n### Patches\n\nPatched in v0.1.3.\n\n### Workarounds\n\nNone.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/jub0bs/cors"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jub0bs/cors/security/advisories/GHSA-vhxv-fg4m-p2w8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jub0bs/cors/commit/5bc0648a32db2d600179a50866f648f4d7090363"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jub0bs/cors/commit/63900fa1776237095fa0ed47ff85791e21f3a7d7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jub0bs/cors"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-03T17:34:17Z",
    "nvd_published_at" : null
  }
}