CVE-2023-22463: Github.com/KubeOperator/kubepi KubePi Allows Malicious Actor To Vulnerability

CRITICAL
Advisory Identifier: GHSA-vjhf-8vqx-vqpq
CVSS 9.8
CWE-798
Published
Advisory Summary

CVE-2023-22463 is a CRITICAL (CVSS 9.8) kubepi allows malicious actor to vulnerability (CWE-798: Use of Hard-coded Credentials) affecting Github.com/KubeOperator/kubepi libraries in the Go ecosystem. The issue involves kubepi allows malicious actor to login with a forged jwt token via hardcoded jwtsigkeys. Remediation is available by upgrading affected packages to version 1.6.3.

CVE-2023-22463 at a Glance

CVE Identifier CVE-2023-22463
GHSA Identifier GHSA-vjhf-8vqx-vqpq
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-798: Use of Hard-coded Credentials
Affected Product Github.com/KubeOperator/kubepi
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.0/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-22463

To remediate this vulnerability, upgrade all affected Github.com/KubeOperator/kubepi 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/KubeOperator/kubepi fixed: 1.6.3
Upgrade github.com/KubeOperator/kubepi to 1.6.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/KubeOperator/kubepi

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-22463, inspect your project dependencies for Github.com/KubeOperator/kubepi:

inspect dependencies for github.com/KubeOperator/kubepi

Analyze the terminal output to locate any version of Github.com/KubeOperator/kubepi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.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 CWE-798: Use of Hard-coded Credentials, where the product contains hard-coded credentials, such as a password or cryptographic key. In Github.com/KubeOperator/kubepi, 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 The jwt authentication function of kubepi <= v1.6.2 uses hard-coded Jwtsigkeys, resulting in the same Jwtsigkeys for all online projects. This means that an attacker can forge any jwt token to take over the administrator account of any online project. ### Details [`session.go`](https://github.com/KubeOperator/KubePi/blob/da784f5532ea2495b92708cacb32703bff3a45a3/internal/api/v1/session/session.go#L35), the use of hard-coded JwtSigKey allows an attacker to use this value to forge jwt tokens arbitrarily. The JwtSigKey is confidential and should not be hard-coded in the code. ```golang var JwtSigKey = []byte("signature_hmac_secret_shared_key") var jwtMaxAge = 10 * time.Minute type Handler struct { userService user.Service roleService role.Service clusterService cluster.Service rolebindingService rolebinding.Service ldapService ldap.Service jwtSigner *jwt.Signer } ``` ### Affected Version <= v1.6.2 ### Patches The vulnerability has been fixed in [v1.6.3](https://github.com/KubeOperator/KubePi/releases/tag/v1.6.3). https://github.com/KubeOperator/KubePi/commit/3be58b8df5bc05d2343c30371dd5fcf6a9fbbf8b : JWT key can be specified in app.yml, if leave it blank a random key will be used. ### Workarounds It is recommended to upgrade the version to [v1.6.3](https://github.com/KubeOperator/KubePi/releases/tag/v1.6.3). ### For more information If you have any questions or comments about this advisory, please [open an issue](https://github.com/KubeOperator/KubePi/issues).

CVE-2023-22463 Affected Github.com/KubeOperator/kubepi Versions

1 component(s)
Fixed Versions:
1.6.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/KubeOperator/kubepi
Go
< 1.6.3
1.6.3

References

Frequently Asked Questions

What is CVE-2023-22463?
CVE-2023-22463 is a security vulnerability in Github.com/KubeOperator/kubepi involving KubePi allows malicious actor to login with a forged JWT token via Hardcoded Jwtsigkeys under CWE-798: Use of Hard-coded Credentials.
Which Github.com/KubeOperator/kubepi versions are affected?
Affected versions include releases prior to 1.6.3 across affected packages: github.com/KubeOperator/kubepi.
What version fixes CVE-2023-22463?
Upgrading to 1.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/KubeOperator/kubepi affected?
Yes, github.com/KubeOperator/kubepi is affected in releases prior to 1.6.3. Upgrade your dependency to 1.6.3 or later.
What is the CVSS score of CVE-2023-22463?
CVE-2023-22463 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-22463?
CVE-2023-22463 is classified under CWE-798: Use of Hard-coded Credentials (The product contains hard-coded credentials, such as a password or cryptographic key.).
How can I check Go dependencies for CVE-2023-22463?
Run the dependency tree command: 'inspect dependencies for github.com/KubeOperator/kubepi'. 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-vjhf-8vqx-vqpq",
  "modified" : "2023-01-06T17:37:58Z",
  "published" : "2023-01-06T17:37:58Z",
  "aliases" : [ "CVE-2023-22463" ],
  "summary" : "KubePi allows malicious actor to login with a forged JWT token via Hardcoded Jwtsigkeys",
  "details" : "### Summary\nThe jwt authentication function of kubepi <= v1.6.2 uses hard-coded Jwtsigkeys, resulting in the same Jwtsigkeys for all online projects. This means that an attacker can forge any jwt token to take over the administrator account of any online project. \n\n### Details\n[`session.go`](https://github.com/KubeOperator/KubePi/blob/da784f5532ea2495b92708cacb32703bff3a45a3/internal/api/v1/session/session.go#L35), the use of hard-coded JwtSigKey allows an attacker to use this value to forge jwt tokens arbitrarily. The JwtSigKey is confidential and should not be hard-coded in the code.\n\n```golang\nvar JwtSigKey = []byte(\"signature_hmac_secret_shared_key\")\nvar jwtMaxAge = 10 * time.Minute\n\ntype Handler struct {\n\tuserService        user.Service\n\troleService        role.Service\n\tclusterService     cluster.Service\n\trolebindingService rolebinding.Service\n\tldapService        ldap.Service\n\tjwtSigner          *jwt.Signer\n}\n```\n### Affected Version\n<= v1.6.2\n\n### Patches\nThe vulnerability has been fixed in [v1.6.3](https://github.com/KubeOperator/KubePi/releases/tag/v1.6.3).\n\nhttps://github.com/KubeOperator/KubePi/commit/3be58b8df5bc05d2343c30371dd5fcf6a9fbbf8b : JWT key can be specified in app.yml, if leave it blank a random key will be used.\n\n### Workarounds\nIt is recommended to upgrade the version to [v1.6.3](https://github.com/KubeOperator/KubePi/releases/tag/v1.6.3).\n\n### For more information\nIf you have any questions or comments about this advisory, please [open an issue](https://github.com/KubeOperator/KubePi/issues).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/KubeOperator/kubepi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.6.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/KubeOperator/KubePi/security/advisories/GHSA-vjhf-8vqx-vqpq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22463"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KubeOperator/KubePi/commit/3be58b8df5bc05d2343c30371dd5fcf6a9fbbf8b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/KubeOperator/KubePi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KubeOperator/KubePi/blob/da784f5532ea2495b92708cacb32703bff3a45a3/internal/api/v1/session/session.go#L35"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KubeOperator/KubePi/releases/tag/v1.6.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-798" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-06T17:37:58Z",
    "nvd_published_at" : "2023-01-04T16:15:00Z"
  }
}