GHSA-w9mr-28mw-j8hg: Github.com/ory/oathkeeper Hop-by-hop Abuse To Malform Header Vulnerability

LOW
Published
Advisory Summary

GHSA-w9mr-28mw-j8hg is a LOW hop-by-hop abuse to malform header vulnerability (General Security Weakness) affecting Github.com/ory/oathkeeper libraries in the Go ecosystem. The issue involves hop-by-hop abuse to malform header mutator. Remediation is available by upgrading affected packages to version 0.40.3.

GHSA-w9mr-28mw-j8hg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w9mr-28mw-j8hg
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/ory/oathkeeper
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-w9mr-28mw-j8hg

To remediate this vulnerability, upgrade all affected Github.com/ory/oathkeeper 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/oathkeeper fixed: 0.40.3
Upgrade github.com/ory/oathkeeper to 0.40.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/ory/oathkeeper

How to Check if You Are Affected

To determine whether your application is affected by GHSA-w9mr-28mw-j8hg, inspect your project dependencies for Github.com/ory/oathkeeper:

inspect dependencies for github.com/ory/oathkeeper

Analyze the terminal output to locate any version of Github.com/ory/oathkeeper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.40.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/ory/oathkeeper, 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 Downstream services relying on the presence of headers set by the `header` mutator could be exploited. A client can drop the header set by the `header` mutator by including that header's name in the `Connection` header. Example minimal config: ```yaml - id: 'example' upstream: url: 'https://example.com' match: url: 'http://127.0.0.1:4455/' methods: - GET authenticators: - handler: anonymous authorizer: handler: allow mutators: - handler: header config: headers: X-Subject: {{ .Subject }} ``` ``` curl -H "Connection: close,x-subject" http://127.0.0.1:4455/ ``` The `X-Subject` header will not arrive at the downstream server. It is completely dropped. In case the downstream server handles such a request in an unexpected way, an attacker can exploit this, assuming they know or guess the internal header name. ### Patches c5cc7f736dc84185034be4356057d1c7a656d797 ### Workarounds The downstream server should handle the case that an expected header is not set by responding with an appropriate error. ### References See background info in https://github.com/golang/go/issues/50580

GHSA-w9mr-28mw-j8hg Affected Github.com/ory/oathkeeper Versions

1 component(s)
Fixed Versions:
0.40.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ory/oathkeeper
Go
< 0.40.3
0.40.3

References

Frequently Asked Questions

What is GHSA-w9mr-28mw-j8hg?
GHSA-w9mr-28mw-j8hg is a security vulnerability in Github.com/ory/oathkeeper involving Hop-by-hop abuse to malform header mutator under General Security Weakness.
Which Github.com/ory/oathkeeper versions are affected?
Affected versions include releases prior to 0.40.3 across affected packages: github.com/ory/oathkeeper.
What version fixes GHSA-w9mr-28mw-j8hg?
Upgrading to 0.40.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ory/oathkeeper affected?
Yes, github.com/ory/oathkeeper is affected in releases prior to 0.40.3. Upgrade your dependency to 0.40.3 or later.
What CWE is associated with GHSA-w9mr-28mw-j8hg?
GHSA-w9mr-28mw-j8hg is classified under General Security Weakness.
How can I check Go dependencies for GHSA-w9mr-28mw-j8hg?
Run the dependency tree command: 'inspect dependencies for github.com/ory/oathkeeper'. 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-w9mr-28mw-j8hg",
  "modified" : "2023-04-27T15:52:24Z",
  "published" : "2023-04-26T19:44:00Z",
  "aliases" : [ ],
  "summary" : "Hop-by-hop abuse to malform header mutator",
  "details" : "### Impact\n\nDownstream services relying on the presence of headers set by the `header` mutator could be exploited. A client can drop the header set by the `header` mutator by including that header's name in the `Connection` header. Example minimal config:\n\n```yaml\n- id: 'example'\n  upstream:\n    url: 'https://example.com'\n  match:\n    url: 'http://127.0.0.1:4455/'\n    methods:\n      - GET\n  authenticators:\n    - handler: anonymous\n  authorizer:\n    handler: allow\n  mutators:\n    - handler: header\n      config:\n        headers:\n          X-Subject: {{ .Subject }}\n```\n\n```\ncurl -H \"Connection: close,x-subject\" http://127.0.0.1:4455/\n```\n\nThe `X-Subject` header will not arrive at the downstream server. It is completely dropped. In case the downstream server handles such a request in an unexpected way, an attacker can exploit this, assuming they know or guess the internal header name.\n\n### Patches\n\nc5cc7f736dc84185034be4356057d1c7a656d797\n\n### Workarounds\n\nThe downstream server should handle the case that an expected header is not set by responding with an appropriate error.\n\n### References\n\nSee background info in https://github.com/golang/go/issues/50580",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ory/oathkeeper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.40.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ory/oathkeeper/security/advisories/GHSA-w9mr-28mw-j8hg"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ory/oathkeeper"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-26T19:44:00Z",
    "nvd_published_at" : null
  }
}