GHSA-VJHF-8VQX-VQPQ

Vulnerability from github – Published: 2023-01-06 17:37 – Updated: 2023-01-06 17:37
VLAI?
Summary
KubePi allows malicious actor to login with a forged JWT token via Hardcoded Jwtsigkeys
Details

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, 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.

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/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.

For more information

If you have any questions or comments about this advisory, please open an issue.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.6.2"
      },
      "package": {
        "ecosystem": "Go",
        "name": "github.com/KubeOperator/kubepi"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.6.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2023-22463"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-798"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-01-06T17:37:58Z",
    "nvd_published_at": "2023-01-04T16:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "### Summary\nThe jwt authentication function of kubepi \u003c= 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\u003c= 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).",
  "id": "GHSA-vjhf-8vqx-vqpq",
  "modified": "2023-01-06T17:37:58Z",
  "published": "2023-01-06T17:37:58Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "KubePi allows malicious actor to login with a forged JWT token via Hardcoded Jwtsigkeys"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…