GHSA-7mwh-q3xm-qh6p

Suggest an improvement
Source
https://github.com/advisories/GHSA-7mwh-q3xm-qh6p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-7mwh-q3xm-qh6p/GHSA-7mwh-q3xm-qh6p.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-7mwh-q3xm-qh6p
Aliases
Published
2024-12-03T18:43:33Z
Modified
2024-12-16T15:26:04Z
Severity
  • 4.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
Vitess allows HTML injection in /debug/querylogz & /debug/env
Details

Summary

The /debug/querylogz and /debug/env pages for vtgate and vttablet do not properly escape user input. The result is that queries executed by Vitess can write HTML into the monitoring page at will.

Details

These pages are rendered using text/template instead of rendering with a proper HTML templating engine.

PoC

Execute any query where part of it is HTML markup, for example as part of a string. To make it easier to observe you might want to make sure the query takes a few seconds to complete, giving you time to refresh the status page.

Example query that can trigger the issue:

UPDATE users
SET
    email = CONCAT("<img src=https://cataas.com/cat/says/oops>", users.idUser, "@xxx")
WHERE
    email NOT LIKE '%xxx%' AND email != "demo@xxx.com"

Result:

image

Impact

Anyone looking at the Vitess status page is affected. This would normally be owners / administrators of the Vitess cluster.

Anyone that can influence what text show up in queries can trigger it. This would normally be pretty much everybody interacting with a system that uses Vitess as a backend.

Database specific
{
    "nvd_published_at": "2024-12-03T16:15:23Z",
    "cwe_ids": [
        "CWE-79"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-03T18:43:33Z"
}
References

Affected packages

Go / vitess.io/vitess

Package

Name
vitess.io/vitess
View open source insights on deps.dev
Purl
pkg:golang/vitess.io/vitess

Affected ranges

Type
SEMVER
Events
Introduced
0.21.0-rc1
Fixed
0.21.1

Go / vitess.io/vitess

Package

Name
vitess.io/vitess
View open source insights on deps.dev
Purl
pkg:golang/vitess.io/vitess

Affected ranges

Type
SEMVER
Events
Introduced
0.20.0-rc1
Fixed
0.20.4

Go / vitess.io/vitess

Package

Name
vitess.io/vitess
View open source insights on deps.dev
Purl
pkg:golang/vitess.io/vitess

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.19.8