Vulnerabilities in pkg:golang/github.com/rancher/apiserver

PACKAGE
Advisory Identifier: GHSA-833m-37f7-jq55
Advisory Summary

CVE-2023-32192 is a HIGH (CVSS 8.3) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Github.com/rancher/apiserver libraries in the Go ecosystem. The issue involves rancher api server cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 0.0.0-20240207153957-4fd7d821d952.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/rancher/apiserver

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/rancher/apiserver. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-833m-37f7-jq55 CVE-2023-32192 HIGH Rancher API Server Cross-site Scripting Vulnerability

CVE-2023-32192 at a Glance

CVE Identifier CVE-2023-32192
GHSA Identifier GHSA-833m-37f7-jq55
Severity HIGH
CVSS v3.1 Base Score 8.3
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Github.com/rancher/apiserver
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.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:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2023-32192

To remediate this vulnerability, upgrade all affected Github.com/rancher/apiserver 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/rancher/apiserver fixed: 0.0.0-20240207153957-4fd7d821d952
Upgrade github.com/rancher/apiserver to 0.0.0-20240207153957-4fd7d821d952
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/rancher/apiserver

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-32192, inspect your project dependencies for Github.com/rancher/apiserver:

inspect dependencies for github.com/rancher/apiserver

Analyze the terminal output to locate any version of Github.com/rancher/apiserver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20240207153957-4fd7d821d952), 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-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Github.com/rancher/apiserver, 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 A vulnerability has been identified in which unauthenticated cross-site scripting (XSS) in the API Server's public API endpoint can be exploited. This can lead to an attacker exploiting the vulnerability to trigger JavaScript code and execute commands remotely. The attack vector was identified as a Reflected XSS. API Server propagates malicious payloads from user input to the UI, which renders the output. For example, a malicious URL gets rendered into a script that is executed on a page. The changes addressed by this fix are: - Encode input that comes from the request URL before adding it to the response. - The request input is escaped by changing the URL construction that is used for links to use `url.URL`. - The request input is escaped by escaping the JavaScript and CSS variables with attribute encoding as defined by [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#output-encoding-rules-summary). ### Patches Patched versions include the following commits: | Branch | Commit | | -------- | ------- | | master | 4fd7d82 | | release/v2.8 | 69b3c2b | | release/v2.8.s3 | a3b9e37 | | release/v2.7 | 4e102cf | | release/v2.7.s3 | 97a10a3 | | release/v2.6 | 4df268e | ### Workarounds There is no direct mitigation besides updating API Server to a patched version. ### References If you have any questions or comments about this advisory: - Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security-related inquiries. - Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository. - Verify with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).

CVE-2023-32192 Affected Github.com/rancher/apiserver Versions

1 component(s)
Fixed Versions:
0.0.0-20240207153957-4fd7d821d952
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rancher/apiserver
Go
< 0.0.0-20240207153957-4fd7d821d952
0.0.0-20240207153957-4fd7d821d952

References

Frequently Asked Questions

What is CVE-2023-32192?
CVE-2023-32192 is a security vulnerability in Github.com/rancher/apiserver involving Rancher API Server Cross-site Scripting Vulnerability under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Github.com/rancher/apiserver versions are affected?
Affected versions include releases prior to 0.0.0-20240207153957-4fd7d821d952 across affected packages: github.com/rancher/apiserver.
What version fixes CVE-2023-32192?
Upgrading to 0.0.0-20240207153957-4fd7d821d952 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/rancher/apiserver affected?
Yes, github.com/rancher/apiserver is affected in releases prior to 0.0.0-20240207153957-4fd7d821d952. Upgrade your dependency to 0.0.0-20240207153957-4fd7d821d952 or later.
What is the CVSS score of CVE-2023-32192?
CVE-2023-32192 has a CVSS v3.1 base score of 8.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2023-32192?
CVE-2023-32192 is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check Go dependencies for CVE-2023-32192?
Run the dependency tree command: 'inspect dependencies for github.com/rancher/apiserver'. 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-833m-37f7-jq55",
  "modified" : "2024-10-16T17:25:51Z",
  "published" : "2024-02-08T18:46:23Z",
  "aliases" : [ "CVE-2023-32192" ],
  "summary" : "Rancher API Server Cross-site Scripting Vulnerability",
  "details" : "### Impact\nA vulnerability has been identified in which unauthenticated cross-site scripting (XSS) in the API Server's public API endpoint can be exploited. This can lead to an attacker exploiting the vulnerability to trigger JavaScript code and execute commands remotely. \n\nThe attack vector was identified as a Reflected XSS.\n\nAPI Server propagates malicious payloads from user input to the UI, which renders the output. For example, a malicious URL gets rendered into a script that is executed on a page.\n\nThe changes addressed by this fix are:\n- Encode input that comes from the request URL before adding it to the response.\n- The request input is escaped by changing the URL construction that is used for links to use `url.URL`.\n- The request input is escaped by escaping the JavaScript and CSS variables with attribute encoding as defined by [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#output-encoding-rules-summary).\n\n### Patches\nPatched versions include the following commits:\n\n| Branch    | Commit |\n| -------- | ------- |\n| master  | 4fd7d82 |\n| release/v2.8 | 69b3c2b |\n| release/v2.8.s3 | a3b9e37 |\n| release/v2.7 | 4e102cf |\n| release/v2.7.s3 | 97a10a3 |\n| release/v2.6 | 4df268e |\n\n### Workarounds\nThere is no direct mitigation besides updating API Server to a patched version.\n\n### References\nIf you have any questions or comments about this advisory:\n\n- Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security-related inquiries.\n- Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository.\n- Verify with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/apiserver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20240207153957-4fd7d821d952"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/security/advisories/GHSA-833m-37f7-jq55"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32192"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/4df268e250f625fa323349062636496e0aeff4e4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/4e102cf0d07b1af3d10d82c3e5a751a869b8a6c7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/4fd7d821d952510bfe38c9d4a3e2a65157f50525"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/69b3c2b56f3fa5a421889c533dada8cd08783cda"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/97a10a30200cb851afd8ee85ee6b2295c4b6e5ee"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rancher/apiserver/commit/a3b9e3721c1b558ee63aec9594e37c223a5c8437"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.suse.com/show_bug.cgi?id=CVE-2023-32192"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rancher/apiserver"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-08T18:46:23Z",
    "nvd_published_at" : "2024-10-16T13:15:12Z"
  }
}