/

CVE-2026-104252

Severity:

CRITICAL RISK

(9.8)

Reflected XSS (CWE-79) in Vitess vttablet Debug API

CVE-2026-104252

Analyzed

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Remote Script Execution and Diagnostic Data Exposure

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vitess contains a reflected cross-site scripting vulnerability in the /twopcz HTTP debug endpoint, where attacker-controlled form values are returned in an HTML response without escaping. Under the default allow-all access policy, an unauthenticated attacker may convince an operator to open a crafted request, causing script execution that can access diagnostic data exposed by the vttablet debug origin.

Vitess contains a reflected cross-site scripting vulnerability in the /twopcz HTTP debug endpoint, where attacker-controlled form values are returned in an HTML response without escaping. Under the default allow-all access policy, an unauthenticated attacker may convince an operator to open a crafted request, causing script execution that can access diagnostic data exposed by the vttablet debug origin.

Affected context

The issue occurs in Vitess deployments that expose the vttablet or vtcombo /twopcz debug endpoint and use an access policy that permits unauthenticated requests. It is relevant when the endpoint reflects the Action or dtid form values into a text/html response without context-appropriate HTML escaping, particularly when an operator opens the resulting URL or response in a browser.

The issue occurs in Vitess deployments that expose the vttablet or vtcombo /twopcz debug endpoint and use an access policy that permits unauthenticated requests. It is relevant when the endpoint reflects the Action or dtid form values into a text/html response without context-appropriate HTML escaping, particularly when an operator opens the resulting URL or response in a browser.

Exploit preconditions

  • Attack surface: The vttablet or vtcombo /twopcz HTTP debug endpoint
  • Required access: Ability to send requests to the endpoint; authentication may not be required under the default allow-all ACL policy
  • Trigger point: An operator opens or views a crafted endpoint response in a browser
  • Why exploitation is possible: User-controlled form values are reflected into an HTML response without output encoding, allowing browser-interpreted script content to execute in the debug origin
  • Attack surface: The vttablet or vtcombo /twopcz HTTP debug endpoint
  • Required access: Ability to send requests to the endpoint; authentication may not be required under the default allow-all ACL policy
  • Trigger point: An operator opens or views a crafted endpoint response in a browser
  • Why exploitation is possible: User-controlled form values are reflected into an HTML response without output encoding, allowing browser-interpreted script content to execute in the debug origin

Why this happens

The vulnerability is caused by reflecting untrusted HTTP form values into an HTML response without applying context-appropriate output encoding.

This is a classic CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting. Because the browser interprets the response as HTML, attacker-controlled content can become executable script rather than remaining inert data.

The vulnerability is caused by reflecting untrusted HTTP form values into an HTML response without applying context-appropriate output encoding.

This is a classic CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting. Because the browser interprets the response as HTML, attacker-controlled content can become executable script rather than remaining inert data.

Potential impact

  • An attacker may execute script in an operator's browser
  • The script could read same-origin diagnostic endpoints exposed by the deployment
  • Query, transaction, environment, variable, or profiling data could be disclosed
  • Operator browser sessions or diagnostic workflows could be manipulated
  • Sensitive operational information could be sent to an attacker-controlled destination
  • An attacker may execute script in an operator's browser
  • The script could read same-origin diagnostic endpoints exposed by the deployment
  • Query, transaction, environment, variable, or profiling data could be disclosed
  • Operator browser sessions or diagnostic workflows could be manipulated
  • Sensitive operational information could be sent to an attacker-controlled destination

General mitigation guidance

Mitigation generally focuses on treating all request parameters as untrusted data and ensuring that debug responses cannot interpret them as markup.

Common defensive patterns include:

  • Applying context-aware HTML escaping to every reflected value
  • Returning structured data such as JSON where HTML rendering is unnecessary
  • Using templating systems with auto-escaping enabled by default
  • Restricting debug endpoints through authentication, authorization, and narrowly scoped network policies
  • Avoiding allow-all access policies for operational interfaces
  • Limiting diagnostic endpoints and processes to the minimum data and privileges required
  • Using browser security controls such as an appropriate Content Security Policy as defense in depth

Mitigation generally focuses on treating all request parameters as untrusted data and ensuring that debug responses cannot interpret them as markup.

Common defensive patterns include:

  • Applying context-aware HTML escaping to every reflected value
  • Returning structured data such as JSON where HTML rendering is unnecessary
  • Using templating systems with auto-escaping enabled by default
  • Restricting debug endpoints through authentication, authorization, and narrowly scoped network policies
  • Avoiding allow-all access policies for operational interfaces
  • Limiting diagnostic endpoints and processes to the minimum data and privileges required
  • Using browser security controls such as an appropriate Content Security Policy as defense in depth

How teams detect issues like this

Detection can include static analysis for request parameters written directly into HTML responses, code review checks for missing output encoding, and tests that submit HTML and script-like marker values to debug endpoints and verify that they are rendered inert.

Policy enforcement can require authentication for administrative and diagnostic endpoints, prohibit allow-all ACLs in production, and scan response templates for auto-escaping bypasses. Automated application security testing and code review tools may help identify reflected input flows.

Detection can include static analysis for request parameters written directly into HTML responses, code review checks for missing output encoding, and tests that submit HTML and script-like marker values to debug endpoints and verify that they are rendered inert.

Policy enforcement can require authentication for administrative and diagnostic endpoints, prohibit allow-all ACLs in production, and scan response templates for auto-escaping bypasses. Automated application security testing and code review tools may help identify reflected input flows.

Sources

SourceLink
github.comgithub.com/vitessio/vitess/commit/3140c1846cd120db34f33b2083139b4ab638aed2
github.comgithub.com/vitessio/vitess/commit/976e1e0d78f9d29d02e5e31b4aa7e180648f08af
github.comgithub.com/vitessio/vitess/commit/c1ed96302e658190168c971afdac730cf70e43f7
github.comgithub.com/vitessio/vitess/pull/20255
github.comgithub.com/vitessio/vitess/pull/20273
github.comgithub.com/vitessio/vitess/pull/20274
github.comgithub.com/vitessio/vitess/releases/tag/v23.0.5
github.comgithub.com/vitessio/vitess/releases/tag/v24.0.2
github.comgithub.com/vitessio/vitess/security/advisories/GHSA-v75v-6fpf-gvw8

Frequently asked

questions

Yes. Where the debug endpoint is reachable and the access policy permits the request, a remote attacker may deliver a crafted URL or request to an operator. Exploitation still generally requires the operator to open or view the resulting response in a browser.

Not necessarily. The default allow-all ACL behavior described for the affected endpoint can permit unauthenticated requests, although deployment-specific network controls and ACL configuration may change the exposure.

Treat form values as untrusted, apply context-aware HTML output encoding, and prefer non-HTML structured responses for diagnostic data. Restrict the endpoint with authentication and least-privilege authorization as an additional control.

Use auto-escaping templates, test every reflected input path, enforce secure policies for debug interfaces, and include XSS checks in static analysis, code review, and dynamic security testing.

Yes. Where the debug endpoint is reachable and the access policy permits the request, a remote attacker may deliver a crafted URL or request to an operator. Exploitation still generally requires the operator to open or view the resulting response in a browser.

Not necessarily. The default allow-all ACL behavior described for the affected endpoint can permit unauthenticated requests, although deployment-specific network controls and ACL configuration may change the exposure.

Treat form values as untrusted, apply context-aware HTML output encoding, and prefer non-HTML structured responses for diagnostic data. Restrict the endpoint with authentication and least-privilege authorization as an additional control.

Use auto-escaping templates, test every reflected input path, enforce secure policies for debug interfaces, and include XSS checks in static analysis, code review, and dynamic security testing.

Find out what's already
exploitable in your codebase.