Vulnerabilities in pkg:golang/github.com/projectcapsule/capsule-proxy

PACKAGE
Advisory Identifier: GHSA-fpvw-6m5v-hqfp
Advisory Summary

CVE-2023-48312 is a CRITICAL (CVSS 9.8) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Github.com/projectcapsule/capsule proxy libraries in the Go ecosystem. The issue involves capsule proxy authentication bypass using an empty token. Remediation is available by upgrading affected packages to version 0.4.6.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/projectcapsule/capsule-proxy

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/projectcapsule/capsule-proxy. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-fpvw-6m5v-hqfp CVE-2023-48312 CRITICAL Capsule Proxy Authentication bypass using an empty token
GHSA-6758-979h-249x CVE-2023-46254 MODERATE capsule-proxy service discloses Namespaces of colliding tenants to owners of different tenants with the same ServiceAccount name

CVE-2023-48312 at a Glance

CVE Identifier CVE-2023-48312
GHSA Identifier GHSA-fpvw-6m5v-hqfp
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/projectcapsule/capsule proxy
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-48312

To remediate this vulnerability, upgrade all affected Github.com/projectcapsule/capsule proxy 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/projectcapsule/capsule-proxy fixed: 0.4.6
Upgrade github.com/projectcapsule/capsule-proxy to 0.4.6
github.com/clastix/capsule-proxy fixed: 0.4.6
Upgrade github.com/clastix/capsule-proxy to 0.4.6
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/projectcapsule/capsule-proxy

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-48312, inspect your project dependencies for Github.com/projectcapsule/capsule proxy:

inspect dependencies for github.com/projectcapsule/capsule-proxy

Analyze the terminal output to locate any version of Github.com/projectcapsule/capsule proxy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.6), 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 Github.com/projectcapsule/capsule proxy, 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

The privilege escalation is based on a missing check if the user is authenticated based on the `TokenReview` result. All the clusters running with the `anonymous-auth` Kubernetes API Server setting disable (set to `false`) are affected since it would be possible to bypass the token review mechanism, interacting with the upper Kubernetes API Server. # PoC Start a KinD cluster with the `anonymous-auth` value to `false`. If it is true, it uses anonymous permissions which are very limited by default ```yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane kubeadmConfigPatches: - | kind: ClusterConfiguration apiServer: extraArgs: anonymous-auth: "false" ``` Install `capsule` and `capsule-proxy` ``` k port-forward svc/capsule-proxy 9001 Forwarding from 127.0.0.1:9001 -> 9001 Forwarding from [::1]:9001 -> 9001 Handling connection for 9001 ``` Then query the proxy ``` curl -g -k -H 'Authorization: Bearer f' -X 'GET' 'https://localhost:9001/api/v1/namespaces' ``` # Impact The whole cluster is exposed to unauthorised users. This privilege escalation cannot be exploited if you're relying only on client certificates (SSL/TLS).

CVE-2023-48312 Affected Github.com/projectcapsule/capsule proxy Versions

2 component(s)
Fixed Versions:
0.4.6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/projectcapsule/capsule-proxy
Go
< 0.4.6
0.4.6
github.com/clastix/capsule-proxy
Go
< 0.4.6
0.4.6

References

Frequently Asked Questions

What is CVE-2023-48312?
CVE-2023-48312 is a security vulnerability in Github.com/projectcapsule/capsule proxy involving Capsule Proxy Authentication bypass using an empty token under CWE-287: Improper Authentication.
Which Github.com/projectcapsule/capsule proxy versions are affected?
Affected versions include releases prior to 0.4.6 across affected packages: github.com/projectcapsule/capsule-proxy, github.com/clastix/capsule-proxy.
What version fixes CVE-2023-48312?
Upgrading to 0.4.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/projectcapsule/capsule-proxy affected?
Yes, github.com/projectcapsule/capsule-proxy is affected in releases prior to 0.4.6. Upgrade your dependency to 0.4.6 or later.
Is github.com/clastix/capsule-proxy affected?
Yes, github.com/clastix/capsule-proxy is affected in releases prior to 0.4.6. Upgrade your dependency to 0.4.6 or later.
What is the CVSS score of CVE-2023-48312?
CVE-2023-48312 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-48312?
CVE-2023-48312 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-2023-48312?
Run the dependency tree command: 'inspect dependencies for github.com/projectcapsule/capsule-proxy'. 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-fpvw-6m5v-hqfp",
  "modified" : "2023-11-27T22:07:37Z",
  "published" : "2023-11-24T16:53:25Z",
  "aliases" : [ "CVE-2023-48312" ],
  "summary" : "Capsule Proxy Authentication bypass using an empty token",
  "details" : "The privilege escalation is based on a missing check if the user is authenticated based on the `TokenReview` result.\n\nAll the clusters running with the `anonymous-auth` Kubernetes API Server setting disable (set to `false`) are affected since it would be possible to bypass the token review mechanism, interacting with the upper Kubernetes API Server.\n\n# PoC\n\nStart a KinD cluster with the `anonymous-auth` value to `false`. \nIf it is true, it uses anonymous permissions which are very limited by default\n\n```yaml\nkind: Cluster\napiVersion: kind.x-k8s.io/v1alpha4\nnodes:\n- role: control-plane\n  kubeadmConfigPatches:\n  - |\n    kind: ClusterConfiguration\n    apiServer:\n        extraArgs:\n          anonymous-auth: \"false\"\n```\n\nInstall `capsule` and `capsule-proxy`\n\n```\nk port-forward svc/capsule-proxy 9001    \nForwarding from 127.0.0.1:9001 -> 9001\nForwarding from [::1]:9001 -> 9001\nHandling connection for 9001\n```\n\nThen query the proxy\n```\ncurl -g -k -H 'Authorization: Bearer   f' -X 'GET' 'https://localhost:9001/api/v1/namespaces'\n```\n\n# Impact\n\nThe whole cluster is exposed to unauthorised users.\n\nThis privilege escalation cannot be exploited if you're relying only on client certificates (SSL/TLS).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/projectcapsule/capsule-proxy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.4.5"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/clastix/capsule-proxy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.4.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/projectcapsule/capsule-proxy/security/advisories/GHSA-fpvw-6m5v-hqfp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-48312"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/projectcapsule/capsule-proxy/commit/472404f7006a4152e4eec76dee07324dd1e6e823"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/projectcapsule/capsule-proxy"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-24T16:53:25Z",
    "nvd_published_at" : "2023-11-24T18:15:07Z"
  }
}