GHSA-2w8w-qhg4-f78j: Github.com/jaegertracing/jaeger Cross-Site Scripting Vulnerability

MODERATE
CVSS 6.5
CWE-79
Published
Advisory Summary

GHSA-2w8w-qhg4-f78j is a MODERATE (CVSS 6.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/jaegertracing/jaeger libraries in the Go ecosystem. The issue involves a stored xss in jaeger ui might allow an attacker who controls a trace to perform arbitrary jaeger queries. Remediation is available by upgrading affected packages to version 1.47.0.

GHSA-2w8w-qhg4-f78j at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2w8w-qhg4-f78j
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/jaegertracing/jaeger
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-2w8w-qhg4-f78j

To remediate this vulnerability, upgrade all affected Github.com/jaegertracing/jaeger 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/jaegertracing/jaeger fixed: 1.47.0
Upgrade github.com/jaegertracing/jaeger to 1.47.0
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/jaegertracing/jaeger

How to Check if You Are Affected

To determine whether your application is affected by GHSA-2w8w-qhg4-f78j, inspect your project dependencies for Github.com/jaegertracing/jaeger:

inspect dependencies for github.com/jaegertracing/jaeger

Analyze the terminal output to locate any version of Github.com/jaegertracing/jaeger in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.47.0), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/jaegertracing/jaeger, 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

Related UI vulnerability advisory: https://github.com/jaegertracing/jaeger-ui/security/advisories/GHSA-vv24-rm95-q56r ### Summary Jaeger UI is using the `json-markup` dependency to display span attributes and resources. This dependency is not sanitising keys of an object though, thus the `KeyValuesTable` is vulnerable to XSS. ### Details The vulnerable line is here: https://github.com/jaegertracing/jaeger-ui/blob/main/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx#L49 ### PoC 1. Start a Jaeger UI 2. Save the following trace as a file: ```json { "data": [ { "traceID": "076ef819cc06c45a", "spans": [ { "traceID": "076ef819cc06c45a", "spanID": "076ef819cc06c45a", "flags": 1, "operationName": "and open 'attributes'", "references": [], "startTime": 1678196149232010, "duration": 13485, "tags": [ { "key": "sampler.type", "type": "string", "value": "{\"<img src=x onerror=alert(1)>\":\"test\"}" } ], "logs": [], "processID": "p1", "warnings": null } ], "processes": { "p1": { "serviceName": "click here", "tags": [ ] } }, "warnings": null } ], "total": 0, "limit": 0, "offset": 0, "errors": null } ``` 3. Upload that trace to Jaeger UI in order to visualise it. 4. Open the trace, open it's span's attributes. 5. XSS should be fired. ### Impact This is a XSS on Jaeger UI. XSS can be used to run JavaScript.

GHSA-2w8w-qhg4-f78j Affected Github.com/jaegertracing/jaeger Versions

1 component(s)
Fixed Versions:
1.47.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/jaegertracing/jaeger
Go
< 1.47.0
1.47.0

References

Frequently Asked Questions

What is GHSA-2w8w-qhg4-f78j?
GHSA-2w8w-qhg4-f78j is a security vulnerability in Github.com/jaegertracing/jaeger involving A stored XSS in jaeger UI might allow an attacker who controls a trace to perform arbitrary jaeger queries under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/jaegertracing/jaeger versions are affected?
Affected versions include releases prior to 1.47.0 across affected packages: github.com/jaegertracing/jaeger.
What version fixes GHSA-2w8w-qhg4-f78j?
Upgrading to 1.47.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/jaegertracing/jaeger affected?
Yes, github.com/jaegertracing/jaeger is affected in releases prior to 1.47.0. Upgrade your dependency to 1.47.0 or later.
What is the CVSS score of GHSA-2w8w-qhg4-f78j?
GHSA-2w8w-qhg4-f78j has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-2w8w-qhg4-f78j?
GHSA-2w8w-qhg4-f78j is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for GHSA-2w8w-qhg4-f78j?
Run the dependency tree command: 'inspect dependencies for github.com/jaegertracing/jaeger'. 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-2w8w-qhg4-f78j",
  "modified" : "2023-07-11T22:45:37Z",
  "published" : "2023-07-11T22:45:37Z",
  "aliases" : [ ],
  "summary" : "A stored XSS in jaeger UI might allow an attacker who controls a trace to perform arbitrary jaeger queries",
  "details" : "Related UI vulnerability advisory: https://github.com/jaegertracing/jaeger-ui/security/advisories/GHSA-vv24-rm95-q56r\n\n### Summary\nJaeger UI is using the `json-markup` dependency to display span attributes and resources. This dependency is not sanitising keys of an object though, thus the `KeyValuesTable` is vulnerable to XSS. \n\n### Details\nThe vulnerable line is here: https://github.com/jaegertracing/jaeger-ui/blob/main/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx#L49\n\n### PoC\n\n1. Start a Jaeger UI\n2. Save the following trace as a file:\n```json\n{\n    \"data\": [\n        {\n            \"traceID\": \"076ef819cc06c45a\",\n            \"spans\": [\n                {\n                    \"traceID\": \"076ef819cc06c45a\",\n                    \"spanID\": \"076ef819cc06c45a\",\n                    \"flags\": 1,\n                    \"operationName\": \"and open 'attributes'\",\n                    \"references\": [],\n                    \"startTime\": 1678196149232010,\n                    \"duration\": 13485,\n                    \"tags\": [\n                        {\n                            \"key\": \"sampler.type\",\n                            \"type\": \"string\",\n                            \"value\": \"{\\\"<img src=x onerror=alert(1)>\\\":\\\"test\\\"}\"\n                        }\n                    ],\n                    \"logs\": [],\n                    \"processID\": \"p1\",\n                    \"warnings\": null\n                }\n            ],\n            \"processes\": {\n                \"p1\": {\n                    \"serviceName\": \"click here\",\n                    \"tags\": [\n                    ]\n                }\n            },\n            \"warnings\": null\n        }\n    ],\n    \"total\": 0,\n    \"limit\": 0,\n    \"offset\": 0,\n    \"errors\": null\n}\n```\n3. Upload that trace to Jaeger UI in order to visualise it.\n4. Open the trace, open it's span's attributes.\n5. XSS should be fired.\n\n### Impact\n\nThis is a XSS on Jaeger UI. XSS can be used to run JavaScript.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/jaegertracing/jaeger"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.47.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jaegertracing/jaeger-ui/security/advisories/GHSA-vv24-rm95-q56r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jaegertracing/jaeger/security/advisories/GHSA-2w8w-qhg4-f78j"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jaegertracing/jaeger"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jaegertracing/jaeger-ui/blob/main/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx#L49"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-11T22:45:37Z",
    "nvd_published_at" : null
  }
}