Common Weakness Enumeration

CWE-80

Weakness Allowed

Improper Neutralization of Script-Related HTML Tags in a Web Page

Abstraction: Variant · Status: Incomplete

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.

Mapping guidance

This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Relationships and members
ChildOf: CWE-79 · View CWE-1000
Modes of introduction
Implementation
Detection methods

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

Notes

Other

Although this can be classified as an injection problem, the more pertinent issue is the improper conversion of such special characters to respective context-appropriate entities before displaying them to the user.

Content history
Submission: PLOVER · 2006-07-19 · CWE Draft 3
Modification: Sean Eidemiller · Cigital · 2008-07-01 · CWE 1.0

added/updated demonstrative examples

Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: · KDM Analytics · 2008-08-01 · CWE 1.0

added/updated white box definitions

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Relationships, Taxonomy_Mappings, Weakness_Ordinalities

Modification: CWE Content Team · MITRE · 2008-10-14 · CWE 1.0.1

updated Description

Modification: CWE Content Team · MITRE · 2009-05-27 · CWE 1.4

updated Demonstrative_Examples, Description, Name

Modification: KDM Analytics · 2009-07-17 · CWE 1.5

Improved the White_Box_Definition

Modification: CWE Content Team · MITRE · 2009-07-27 · CWE 1.5

updated White_Box_Definitions

Modification: CWE Content Team · MITRE · 2010-06-21 · CWE 1.9

updated Demonstrative_Examples, Description, Name, Potential_Mitigations

Modification: CWE Content Team · MITRE · 2011-03-29 · CWE 1.12

updated Description, Potential_Mitigations

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Related_Attack_Patterns, Relationships

Modification: CWE Content Team · MITRE · 2012-10-30 · CWE 2.3

updated Potential_Mitigations

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2017-05-03 · CWE 2.11

updated Potential_Mitigations, Related_Attack_Patterns

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Applicable_Platforms, Causal_Nature, Likelihood_of_Exploit, Relationships, White_Box_Definitions

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Relationships

Modification: CWE Content Team · MITRE · 2020-06-25 · CWE 4.1

updated Potential_Mitigations

Modification: CWE Content Team · MITRE · 2021-10-28 · CWE 4.6

updated Relationships

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Description

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Detection_Factors, Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2025-09-09 · CWE 4.18

updated Common_Consequences, Description, Diagram, Other_Notes

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Applicable_Platforms, Relationships

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

updated Alternate_Terms, Name

1209 vulnerabilities reference this CWE, most recent first.

GHSA-V3P7-7CCR-QM48

Vulnerability from github – Published: 2026-01-07 12:31 – Updated: 2026-04-08 21:33
VLAI
Details

The Responsive Pricing Table plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'table_currency' parameter in all versions up to, and including, 5.1.12 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-15058"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-01-07T12:16:59Z",
    "severity": "MODERATE"
  },
  "details": "The Responsive Pricing Table plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the \u0027table_currency\u0027 parameter in all versions up to, and including, 5.1.12 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.",
  "id": "GHSA-v3p7-7ccr-qm48",
  "modified": "2026-04-08T21:33:09Z",
  "published": "2026-01-07T12:31:23Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-15058"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/changeset?sfp_email=\u0026sfph_mail=\u0026reponame=\u0026old=3435445%40dk-pricr-responsive-pricing-table\u0026new=3435445%40dk-pricr-responsive-pricing-table\u0026sfp_email=\u0026sfph_mail="
    },
    {
      "type": "WEB",
      "url": "https://wordpress.org/plugins/dk-pricr-responsive-pricing-table"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/e20a34e5-6c1c-4f12-b1d8-aa4b40a5dd00?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-V57P-Q7G2-4G2R

Vulnerability from github – Published: 2024-02-22 15:30 – Updated: 2024-08-26 21:30
VLAI
Details

Enhavo v0.13.1 was discovered to contain an HTML injection vulnerability in the Author text field under the Blockquote module. This vulnerability allows attackers to execute arbitrary code via a crafted payload.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-25873"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-02-22T14:15:46Z",
    "severity": "MODERATE"
  },
  "details": "Enhavo v0.13.1 was discovered to contain an HTML injection vulnerability in the Author text field under the Blockquote module. This vulnerability allows attackers to execute arbitrary code via a crafted payload.",
  "id": "GHSA-v57p-q7g2-4g2r",
  "modified": "2024-08-26T21:30:31Z",
  "published": "2024-02-22T15:30:38Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-25873"
    },
    {
      "type": "WEB",
      "url": "https://github.com/dd3x3r/enhavo/blob/main/html-injection-page-content-blockquote-author-v0.13.1.md"
    },
    {
      "type": "WEB",
      "url": "https://www.enhavo.com"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-V65J-HFF3-753C

Vulnerability from github – Published: 2026-09-25 15:03 – Updated: 2026-09-25 15:03
VLAI
Summary
Mediawiki EmbedVideo Extension has stored XSS via malformed src url with $wgEmbedVideoRequireConsent disabled
Details

Summary

With $wgEmbedVideoRequireConsent disabled (not the default), the urls for videos are passed into an iframe src attribute without sanitization. When given a malformed url or id, the src attribute can be escaped via double quotes, allowing for html/javascript injection.

Details

The iframe assembled here adds the url from getUrl() as the src without sanitization. The id regex for the archiveorg service and the url regexes for the wistia and sharepoint services allow for double quotes to be introduced.

PoC

Using double quotes, the src attribute can be escaped.

<embedvideo service="archiveorg" id='a" onmouseover="alert(document.domain)" data-x="'></embedvideo>

Impact

When $wgEmbedVideoRequireConsent = false, any user able to edit a page can inject arbitrary JavaScript into an HTML event handler attribute (e.g. onfocus) via parameter. It requires no interaction (autofires via autofocus) and executes in the wiki origin for every visitor to the page.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 4.0.0"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "starcitizenwiki/embedvideo"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.1.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-57440"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-80"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-09-25T15:03:43Z",
    "nvd_published_at": "2026-09-24T19:17:14Z",
    "severity": "HIGH"
  },
  "details": "### Summary\nWith $wgEmbedVideoRequireConsent disabled (not the default), the urls for videos are passed into an iframe src attribute without sanitization. When given a malformed url or id, the src attribute can be escaped via double quotes, allowing for html/javascript injection.\n\n### Details\nThe iframe assembled [here](https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo/blob/a573a16d925ee0ea0d34b360856dc8ab0b88f822/includes/EmbedService/EmbedHtmlFormatter.php#L204-L208) adds the url from `getUrl()` as the src without sanitization.\nThe id regex for the archiveorg service and the url regexes for the wistia and sharepoint services allow for double quotes to be introduced.\n\n### PoC\nUsing double quotes, the src attribute can be escaped.\n```\n\u003cembedvideo service=\"archiveorg\" id=\u0027a\" onmouseover=\"alert(document.domain)\" data-x=\"\u0027\u003e\u003c/embedvideo\u003e\n```\n\n### Impact\nWhen $wgEmbedVideoRequireConsent = false, any user able to edit a page can inject arbitrary JavaScript into an HTML event handler attribute (e.g. onfocus) via parameter. It requires no interaction (autofires via autofocus) and executes in the wiki origin for every visitor to the page.",
  "id": "GHSA-v65j-hff3-753c",
  "modified": "2026-09-25T15:03:43Z",
  "published": "2026-09-25T15:03:43Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo/security/advisories/GHSA-v65j-hff3-753c"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-57440"
    },
    {
      "type": "WEB",
      "url": "https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo/commit/370156335b325bb81d14d89edf0a1f2643d50a84"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Mediawiki EmbedVideo Extension has stored XSS via malformed src url with $wgEmbedVideoRequireConsent disabled"
}

GHSA-V6X2-4Q87-RF82

Vulnerability from github – Published: 2025-11-27 12:30 – Updated: 2026-04-14 21:57
VLAI
Summary
Apache SkyWalking has a stored XSS vulnerability
Details

There is an Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in Apache SkyWalking.

This issue affects Apache SkyWalking versions <= 10.2.0.

Users are recommended to upgrade to version 10.3.0, which fixes the issue. Version 10.3.0 has not been uploaded to the Maven registry at time of publish, please see release notes for download instructions.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.apache.skywalking:apm-webapp"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "10.1.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-54057"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-12-05T21:46:59Z",
    "nvd_published_at": "2025-11-27T12:15:47Z",
    "severity": "MODERATE"
  },
  "details": "There is an Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in Apache SkyWalking.\n\nThis issue affects Apache SkyWalking versions \u003c= 10.2.0.\n\nUsers are recommended to upgrade to version 10.3.0, which fixes the issue. Version 10.3.0 has not been uploaded to the Maven registry at time of publish, please see [release notes](https://github.com/apache/skywalking/releases/tag/v10.3.0) for download instructions.",
  "id": "GHSA-v6x2-4q87-rf82",
  "modified": "2026-04-14T21:57:18Z",
  "published": "2025-11-27T12:30:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-54057"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apache/skywalking"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/sl2x2tx8y007x0mo746yddx2lvnv9tcr"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2025/11/27/1"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2026/04/13/3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Apache SkyWalking has a stored XSS vulnerability"
}

GHSA-V73P-F52R-FMMR

Vulnerability from github – Published: 2026-06-22 09:30 – Updated: 2026-09-11 22:05
VLAI
Summary
Apache Atlas UI: Authenticated User XSS
Details

An authenticated user can perform XSS.

This issue affects Apache Atlas versions 2.4.0 and earlier.

Users are recommended to upgrade to version 2.5.0, which fixes the issue.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.apache.atlas:atlas-dashboardv2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.5.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-62198"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-09-11T22:05:26Z",
    "nvd_published_at": "2026-06-22T08:16:35Z",
    "severity": "MODERATE"
  },
  "details": "An authenticated user can perform XSS.\n\nThis issue affects Apache Atlas versions 2.4.0 and earlier.\n\nUsers are recommended to upgrade to version 2.5.0, which fixes the issue.",
  "id": "GHSA-v73p-f52r-fmmr",
  "modified": "2026-09-11T22:05:26Z",
  "published": "2026-06-22T09:30:45Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-62198"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apache/atlas/commit/800f979307d6ea0f0b6563ec890f6b728022e497"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apache/atlas"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/nv893lhz3ok08f25j3v4z1to5nrpdp7k"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2026/06/20/1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Apache Atlas UI: Authenticated User XSS"
}

GHSA-V75V-6FPF-GVW8

Vulnerability from github – Published: 2026-10-15 20:16 – Updated: 2026-10-15 20:16
VLAI
Summary
Vitess vttablet /twopcz reflected XSS
Details

From: xylove21 To: security@vitess.io Subject: [Security Report] Vitess vttablet /twopcz reflected XSS Date: Tue, 24 Jun 2026 14:30:00 +0800

Summary

The twopczHandler in go/vt/vttablet/tabletserver/twopcz.go (line 185) reflects the Action and dtid form values directly into the HTML response body via fmt.Fprintln(w, msg) — without HTML escaping. The response is served as text/html; charset=utf-8, and Vitess's default acl policy is allow-all, so the endpoint is reachable by anyone who can hit the vttablet's HTTP port (default 15999, multiplexed with gRPC and MySQL wire-protocol ports).

A crafted Action or dtid value yields a reflected XSS that executes in the operator's browser with same-origin access to the vttablet's debug endpoints. This includes /queryz (live query plans), /querylogz (recent queries with bound values), /txlogz (transactions), /debug/env (environment variables — may include MySQL/topology credentials), /debug/vars (expvar stats), and /debug/pprof/* if enabled.

The bug was introduced before v20.0.0 (long-standing) and was silently fixed in commit 3140c1846c (merged 2026-06-09, PR #20255, "tabletserver: escape reflected form values in twopcz handler"). The fix replaces fmt.Fprintln(w, msg) with fmt.Fprintln(w, html.EscapeString(msg)). No released version of Vitess contains the fix — the fix lives only on main (current tip 33a3c0fafe69, 2026-06-23). There is no CVE, GHSA, or OSV entry for this specific bug (verified 2026-06-24 against GitHub Advisory Database, OSV.dev, and NVD).

Impact

Field Value
Type Reflected Cross-Site Scripting (XSS)
CVSS 3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N = 7.7 HIGH
Attack Vector Network (vttablet HTTP port 15999, multiplexed with gRPC/MySQL)
Attack Complexity Low (craft URL, send to operator)
Privileges Required None (default acl policy is allow-all)
User Interaction Required (operator must visit crafted URL)
Scope Changed (XSS chain reaction to other vttablet debug endpoints)
Confidentiality High (query text, env vars, expvar stats)
Integrity None (XSS itself doesn't change state)
Availability None (XSS itself doesn't disrupt service)

Affected versions (verified)

All released versions are vulnerable. The fix lives only on main:

Tag Released twopcz.go line 185 Status
v20.0.0 2024-06-27 fmt.Fprintln(w, msg) BUGGY
v20.0.1 - v20.0.6 2024 fmt.Fprintln(w, msg) BUGGY
v22.0.4 2026-02-27 fmt.Fprintln(w, msg) BUGGY
v23.0.3, v23.0.4 2026-02 / 2026-05 fmt.Fprintln(w, msg) BUGGY
v24.0.0, v24.0.1 2026-04 / 2026-05 fmt.Fprintln(w, msg) BUGGY
main (33a3c0fafe69) 2026-06-23 fmt.Fprintln(w, html.EscapeString(msg)) FIXED

Sensitive data exposed via the same-origin XSS chain

A successful XSS lands in the vttablet's origin. From there, the attacker can fetch (via fetch() from injected JavaScript) the following same-origin endpoints, all of which are unauthenticated by default:

  • /twopcz — in-flight 2PC transactions (query text, parameters, dtid)
  • /queryz — live query plans
  • /querylogz — recent queries with bound values
  • /txlogz — transactions
  • /debug/env — environment variables (may include MySQL creds, topology credentials, encryption keys)
  • /debug/vars — expvar stats
  • /debug/pprof/* — CPU/memory profiles (if enabled)

Reproduction (independent, runnable PoC)

The PoC is a self-contained Go HTTP server that replicates the buggy twopczHandler from Vitess v20.0.0 verbatim (using the same line-185 code). It runs on 127.0.0.1:15080 and returns the same response shape as the real Vitess endpoint.

# 1) Build the PoC (Go 1.23+)
cd /path/to/finding/CVE-pending-twopcz-xss
go build -o /tmp/vitess-twopcz-poc ./poc.go

# 2) Start the buggy server
ADDR=127.0.0.1:15080 /tmp/vitess-twopcz-poc &

# 3) Reproduce — Test 1: bare GET (no params)
curl -sS -i "http://127.0.0.1:15080/twopcz"
# → Content-Type: text/html; charset=utf-8, status 200

# 4) Test 2: XSS via Action param (URL-encode the script tag)
curl -sS -i "http://127.0.0.1:15080/twopcz?Action=%3Cscript%3Ealert(1)%3C%2Fscript%3E&dtid=zz"
# → Response body contains literal "<script>alert(1)</script>(zz): completed."
# → Browser executes the script as same-origin code

# 5) Test 3: XSS via dtid param (attribute-context payload)
curl -sS -i "http://127.0.0.1:15080/twopcz?Action=Demo&dtid=%3Cimg%20src%3Dx%20onerror%3Dalert(1)%3E"
# → Response body contains literal "<img src=x onerror=alert(1)>"
# → Browser fires the onerror handler as same-origin code

# 6) Run the 3x automated runner (writes evidence/run-{1,2,3}.log)
bash ./poc/run.sh

PoC result excerpt (from evidence/run-1.log):

--- Test 2: XSS via Action=<script>alert(1)</script> ---
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
...
<h2>WARNING: Actions on this page can jeopardize data integrity.</h2>
<script>alert(1)</script>(zz): completed.

PASS: payload reflected UNESCAPED (XSS exploitable in browser)

The PoC was run 3 times on the buggy server (all 3/3 PASS) and the same code is byte-identical to the v20.0.0 commit 8aeb274f6c8e line 185.

Root cause (technical detail)

go/vt/vttablet/tabletserver/twopcz.go (v20.0.0 through v24.0.1):

// Line 185
fmt.Fprintln(w, msg)

msg is constructed earlier in the handler as:

msg := fmt.Sprintf("%s(%s): completed.", action, dtid)

with action and dtid coming from the form values r.FormValue("Action") and r.FormValue("dtid"). The form values are URL-decoded (so a + becomes a space, %3C becomes <) but never HTML-escaped. The handler explicitly sets Content-Type: text/html; charset=utf-8 (via the <!DOCTYPE html> it writes first), so the browser executes any injected <script> or attribute-context payload.

The fix in main (fmt.Fprintln(w, html.EscapeString(msg))) closes the hole by HTML-escaping both action and dtid before reflection.

Suggested fix (already in main)

// Recommended minimal patch (already in main, needs backport to all release branches):
import "html"

func twopczHandler(w http.ResponseWriter, r *http.Request) {
    // ... existing logic ...
    msg := fmt.Sprintf("%s(%s): completed.", action, dtid)
    fmt.Fprintln(w, html.EscapeString(msg))  // ← was: fmt.Fprintln(w, msg)
}

Backport the fix to v20.0.x, v22.0.x, v23.0.x, and v24.0.x as patch releases. The fix is one line and a one-line import "html" addition, so the backport risk is minimal.

Workaround / mitigation (no patch available)

If you cannot upgrade to a fixed release immediately:

  1. Restrict the vttablet HTTP port (default 15999) to localhost only. vttablet can run with --tablet-allow-stats=false and --tablet-grpc-port configured separately from the HTTP port, or you can firewall the HTTP port at the network layer. The debug endpoints are not needed by production traffic.

  2. Set a non-default ACL policy. Vitess supports an acl policy that defaults to allow-all. Setting it to a JSON file that denies unauthenticated access to debug endpoints (see go/acl/acl.go::savePolicy) would block the XSS, but the default policy is currently "" (allow-all) and many users don't override it.

  3. Use a reverse proxy (nginx, envoy) in front of the vttablet HTTP port with a strict allowlist of clients.

Cross-references

  • The bug is not related to:
    • CVE-2024-53257 (/debug/querylogz HTML injection, fixed in v20.0.4 — different endpoint)
    • CVE-2026-27969 (backup MANIFEST path traversal)
    • CVE-2026-27965 / GHSA-8g8j-r87h-p36x (backup external decompressor RCE)
  • PR #20255 is the fix commit; PR #19486 (defense-in-depth) is a separate hardening change

Contact

  • GitHub: @xylove21
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "vitess.io/vitess"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.23.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "vitess.io/vitess"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.24.0"
            },
            {
              "fixed": "0.24.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-104252"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-116",
      "CWE-79",
      "CWE-80"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-15T20:16:29Z",
    "nvd_published_at": "2026-10-13T20:17:12Z",
    "severity": "CRITICAL"
  },
  "details": "From: xylove21\nTo: security@vitess.io\nSubject: [Security Report] Vitess vttablet /twopcz reflected XSS\nDate: Tue, 24 Jun 2026 14:30:00 +0800\n\n## Summary\n\nThe `twopczHandler` in\n`go/vt/vttablet/tabletserver/twopcz.go` (line 185) reflects the `Action`\nand `dtid` form values directly into the HTML response body via\n`fmt.Fprintln(w, msg)` \u2014 **without HTML escaping**. The response is served\nas `text/html; charset=utf-8`, and Vitess\u0027s default `acl` policy is\n**allow-all**, so the endpoint is reachable by anyone who can hit the\nvttablet\u0027s HTTP port (default `15999`, multiplexed with gRPC and MySQL\nwire-protocol ports).\n\nA crafted `Action` or `dtid` value yields a **reflected XSS** that\nexecutes in the operator\u0027s browser with same-origin access to the\nvttablet\u0027s debug endpoints. This includes `/queryz` (live query plans),\n`/querylogz` (recent queries with bound values), `/txlogz` (transactions),\n`/debug/env` (environment variables \u2014 may include MySQL/topology\ncredentials), `/debug/vars` (expvar stats), and `/debug/pprof/*` if\nenabled.\n\nThe bug was introduced before v20.0.0 (long-standing) and was silently\nfixed in commit `3140c1846c` (merged 2026-06-09, PR #20255,\n\"tabletserver: escape reflected form values in twopcz handler\"). The\nfix replaces `fmt.Fprintln(w, msg)` with\n`fmt.Fprintln(w, html.EscapeString(msg))`. **No released version of\nVitess contains the fix** \u2014 the fix lives only on `main` (current tip\n`33a3c0fafe69`, 2026-06-23). There is **no CVE, GHSA, or OSV entry**\nfor this specific bug (verified 2026-06-24 against GitHub Advisory\nDatabase, OSV.dev, and NVD).\n\n## Impact\n\n| Field | Value |\n|-------|-------|\n| **Type** | Reflected Cross-Site Scripting (XSS) |\n| **CVSS 3.1** | `AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N` = **7.7 HIGH** |\n| **Attack Vector** | Network (vttablet HTTP port 15999, multiplexed with gRPC/MySQL) |\n| **Attack Complexity** | Low (craft URL, send to operator) |\n| **Privileges Required** | None (default `acl` policy is allow-all) |\n| **User Interaction** | Required (operator must visit crafted URL) |\n| **Scope** | Changed (XSS chain reaction to other vttablet debug endpoints) |\n| **Confidentiality** | High (query text, env vars, expvar stats) |\n| **Integrity** | None (XSS itself doesn\u0027t change state) |\n| **Availability** | None (XSS itself doesn\u0027t disrupt service) |\n\n### Affected versions (verified)\n\nAll released versions are vulnerable. The fix lives only on `main`:\n\n| Tag | Released | `twopcz.go` line 185 | Status |\n|---|---|---|---|\n| v20.0.0 | 2024-06-27 | `fmt.Fprintln(w, msg)` | **BUGGY** |\n| v20.0.1 - v20.0.6 | 2024 | `fmt.Fprintln(w, msg)` | **BUGGY** |\n| v22.0.4 | 2026-02-27 | `fmt.Fprintln(w, msg)` | **BUGGY** |\n| v23.0.3, v23.0.4 | 2026-02 / 2026-05 | `fmt.Fprintln(w, msg)` | **BUGGY** |\n| v24.0.0, v24.0.1 | 2026-04 / 2026-05 | `fmt.Fprintln(w, msg)` | **BUGGY** |\n| **main** (`33a3c0fafe69`) | 2026-06-23 | `fmt.Fprintln(w, html.EscapeString(msg))` | **FIXED** |\n\n### Sensitive data exposed via the same-origin XSS chain\n\nA successful XSS lands in the vttablet\u0027s origin. From there, the\nattacker can fetch (via `fetch()` from injected JavaScript) the\nfollowing same-origin endpoints, all of which are unauthenticated by\ndefault:\n\n- `/twopcz` \u2014 in-flight 2PC transactions (query text, parameters, dtid)\n- `/queryz` \u2014 live query plans\n- `/querylogz` \u2014 recent queries with bound values\n- `/txlogz` \u2014 transactions\n- `/debug/env` \u2014 environment variables (may include MySQL creds, topology\n  credentials, encryption keys)\n- `/debug/vars` \u2014 expvar stats\n- `/debug/pprof/*` \u2014 CPU/memory profiles (if enabled)\n\n## Reproduction (independent, runnable PoC)\n\nThe PoC is a self-contained Go HTTP server that replicates the buggy\n`twopczHandler` from Vitess v20.0.0 verbatim (using the same line-185\ncode). It runs on `127.0.0.1:15080` and returns the same response shape\nas the real Vitess endpoint.\n\n```bash\n# 1) Build the PoC (Go 1.23+)\ncd /path/to/finding/CVE-pending-twopcz-xss\ngo build -o /tmp/vitess-twopcz-poc ./poc.go\n\n# 2) Start the buggy server\nADDR=127.0.0.1:15080 /tmp/vitess-twopcz-poc \u0026\n\n# 3) Reproduce \u2014 Test 1: bare GET (no params)\ncurl -sS -i \"http://127.0.0.1:15080/twopcz\"\n# \u2192 Content-Type: text/html; charset=utf-8, status 200\n\n# 4) Test 2: XSS via Action param (URL-encode the script tag)\ncurl -sS -i \"http://127.0.0.1:15080/twopcz?Action=%3Cscript%3Ealert(1)%3C%2Fscript%3E\u0026dtid=zz\"\n# \u2192 Response body contains literal \"\u003cscript\u003ealert(1)\u003c/script\u003e(zz): completed.\"\n# \u2192 Browser executes the script as same-origin code\n\n# 5) Test 3: XSS via dtid param (attribute-context payload)\ncurl -sS -i \"http://127.0.0.1:15080/twopcz?Action=Demo\u0026dtid=%3Cimg%20src%3Dx%20onerror%3Dalert(1)%3E\"\n# \u2192 Response body contains literal \"\u003cimg src=x onerror=alert(1)\u003e\"\n# \u2192 Browser fires the onerror handler as same-origin code\n\n# 6) Run the 3x automated runner (writes evidence/run-{1,2,3}.log)\nbash ./poc/run.sh\n```\n\nPoC result excerpt (from `evidence/run-1.log`):\n\n```\n--- Test 2: XSS via Action=\u003cscript\u003ealert(1)\u003c/script\u003e ---\nHTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\n...\n\u003ch2\u003eWARNING: Actions on this page can jeopardize data integrity.\u003c/h2\u003e\n\u003cscript\u003ealert(1)\u003c/script\u003e(zz): completed.\n\nPASS: payload reflected UNESCAPED (XSS exploitable in browser)\n```\n\nThe PoC was run 3 times on the buggy server (all 3/3 PASS) and the same\ncode is byte-identical to the v20.0.0 commit `8aeb274f6c8e` line 185.\n\n## Root cause (technical detail)\n\n`go/vt/vttablet/tabletserver/twopcz.go` (v20.0.0 through v24.0.1):\n\n```go\n// Line 185\nfmt.Fprintln(w, msg)\n```\n\n`msg` is constructed earlier in the handler as:\n\n```go\nmsg := fmt.Sprintf(\"%s(%s): completed.\", action, dtid)\n```\n\nwith `action` and `dtid` coming from the form values\n`r.FormValue(\"Action\")` and `r.FormValue(\"dtid\")`. The form values are\nURL-decoded (so a `+` becomes a space, `%3C` becomes `\u003c`) but never\nHTML-escaped. The handler explicitly sets `Content-Type: text/html;\ncharset=utf-8` (via the `\u003c!DOCTYPE html\u003e` it writes first), so the\nbrowser executes any injected `\u003cscript\u003e` or attribute-context payload.\n\nThe fix in main (`fmt.Fprintln(w, html.EscapeString(msg))`) closes the\nhole by HTML-escaping both `action` and `dtid` before reflection.\n\n## Suggested fix (already in main)\n\n```go\n// Recommended minimal patch (already in main, needs backport to all release branches):\nimport \"html\"\n\nfunc twopczHandler(w http.ResponseWriter, r *http.Request) {\n    // ... existing logic ...\n    msg := fmt.Sprintf(\"%s(%s): completed.\", action, dtid)\n    fmt.Fprintln(w, html.EscapeString(msg))  // \u2190 was: fmt.Fprintln(w, msg)\n}\n```\n\nBackport the fix to v20.0.x, v22.0.x, v23.0.x, and v24.0.x as patch\nreleases. The fix is one line and a one-line `import \"html\"` addition,\nso the backport risk is minimal.\n\n## Workaround / mitigation (no patch available)\n\nIf you cannot upgrade to a fixed release immediately:\n\n1. **Restrict the vttablet HTTP port** (default 15999) to localhost\n   only. vttablet can run with `--tablet-allow-stats=false` and\n   `--tablet-grpc-port` configured separately from the HTTP port, or\n   you can firewall the HTTP port at the network layer. The debug\n   endpoints are not needed by production traffic.\n\n2. **Set a non-default ACL policy**. Vitess supports an `acl` policy\n   that defaults to allow-all. Setting it to a JSON file that denies\n   unauthenticated access to debug endpoints (see\n   `go/acl/acl.go::savePolicy`) would block the XSS, but the default\n   policy is currently `\"\"` (allow-all) and many users don\u0027t override\n   it.\n\n3. **Use a reverse proxy** (nginx, envoy) in front of the vttablet\n   HTTP port with a strict allowlist of clients.\n\n## Cross-references\n\n  - The bug is **not** related to:\n    - CVE-2024-53257 (`/debug/querylogz` HTML injection, fixed in\n      v20.0.4 \u2014 different endpoint)\n    - CVE-2026-27969 (backup MANIFEST path traversal)\n    - CVE-2026-27965 / GHSA-8g8j-r87h-p36x (backup external decompressor\n      RCE)\n  - PR #20255 is the fix commit; PR #19486 (defense-in-depth) is a\n    separate hardening change\n\n## Contact\n\n  - GitHub: @xylove21",
  "id": "GHSA-v75v-6fpf-gvw8",
  "modified": "2026-10-15T20:16:29Z",
  "published": "2026-10-15T20:16:29Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/security/advisories/GHSA-v75v-6fpf-gvw8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-104252"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/pull/20255"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/pull/20273"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/pull/20274"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/commit/3140c1846cd120db34f33b2083139b4ab638aed2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/commit/976e1e0d78f9d29d02e5e31b4aa7e180648f08af"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/commit/c1ed96302e658190168c971afdac730cf70e43f7"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/vitessio/vitess"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/releases/tag/v23.0.5"
    },
    {
      "type": "WEB",
      "url": "https://github.com/vitessio/vitess/releases/tag/v24.0.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Vitess vttablet /twopcz reflected XSS"
}

GHSA-V7CH-CX27-643J

Vulnerability from github – Published: 2023-04-11 18:30 – Updated: 2024-04-04 03:24
VLAI
Details

An improper neutralization of script-related HTML tags in a web page vulnerability [CWE-80] in FortiAuthenticator versions 6.4.0 through 6.4.4, 6.3.0 through 6.3.3, all versions of 6.2 and 6.1 may allow a remote unauthenticated attacker to trigger a reflected cross site scripting (XSS) attack via the "reset-password" page.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-35850"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-80"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-04-11T17:15:00Z",
    "severity": "MODERATE"
  },
  "details": "An improper neutralization of script-related HTML tags in a web page vulnerability [CWE-80] in FortiAuthenticator versions 6.4.0 through 6.4.4, 6.3.0 through 6.3.3, all versions of 6.2 and 6.1 may allow a remote unauthenticated attacker to trigger a reflected cross site scripting (XSS) attack via the \"reset-password\" page.",
  "id": "GHSA-v7ch-cx27-643j",
  "modified": "2024-04-04T03:24:22Z",
  "published": "2023-04-11T18:30:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-35850"
    },
    {
      "type": "WEB",
      "url": "https://fortiguard.com/psirt/FG-IR-22-275"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-V9C4-FH6F-GJF9

Vulnerability from github – Published: 2026-11-07 06:31 – Updated: 2026-11-07 06:31
VLAI
Details

IBM API Connect 10.0.8.0 through 10.0.8.12 and 12.1.0.0 through 12.1.1.2 could allow a remote authenticated attacker to perform HTML injection due to improper neutralization of user-supplied input.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-17143"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-07T05:18:27Z",
    "severity": "MODERATE"
  },
  "details": "IBM API Connect 10.0.8.0 through 10.0.8.12 and 12.1.0.0 through 12.1.1.2 could allow a remote authenticated attacker to perform HTML injection due to improper neutralization of user-supplied input.",
  "id": "GHSA-v9c4-fh6f-gjf9",
  "modified": "2026-11-07T06:31:16Z",
  "published": "2026-11-07T06:31:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-17143"
    },
    {
      "type": "WEB",
      "url": "https://www.ibm.com/support/pages/node/7295635"
    },
    {
      "type": "WEB",
      "url": "https://www.ibm.com/support/pages/node/7295637"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-VF6X-59HH-332F

Vulnerability from github – Published: 2025-03-01 00:11 – Updated: 2026-02-18 23:47
VLAI
Summary
Formwork has a cross-site scripting (XSS) vulnerability in Site title
Details

Summary

The site title field at /panel/options/site/allows embedding JS tags, which can be used to attack all members of the system. This is a widespread attack and can cause significant damage if there is a considerable number of users.

Impact

The attack is widespread, leveraging what XSS can do. This will undoubtedly impact system availability.

Patches

Details

By embedding "<!--", the source code can be rendered non-functional, significantly impacting system availability. However, the attacker would need admin privileges, making the attack more difficult to execute.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "getformwork/formwork"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.0.0-beta.3"
            },
            {
              "fixed": "2.0.0-beta.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "2.0.0-beta.3"
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-01T00:11:46Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "### Summary\n\nThe site title field at /panel/options/site/allows embedding JS tags, which can be used to attack all members of the system. This is a widespread attack and can cause significant damage if there is a considerable number of users.\n\n### Impact\n\nThe attack is widespread, leveraging what XSS can do. This will undoubtedly impact system availability.\n\n### Patches\n- [**Formwork 2.x** (aa3e9c6)](https://github.com/getformwork/formwork/commit/aa3e9c684035d9e8495169fde7c57d97faa3f9a2) escapes site title from panel header navigation.\n\n### Details\n\nBy embedding \"\u003c!--\", the source code can be rendered non-functional, significantly impacting system availability. However, the attacker would need admin privileges, making the attack more difficult to execute.",
  "id": "GHSA-vf6x-59hh-332f",
  "modified": "2026-02-18T23:47:22Z",
  "published": "2025-03-01T00:11:46Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/getformwork/formwork/security/advisories/GHSA-vf6x-59hh-332f"
    },
    {
      "type": "WEB",
      "url": "https://github.com/getformwork/formwork/commit/aa3e9c684035d9e8495169fde7c57d97faa3f9a2"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/getformwork/formwork"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": " Formwork has a cross-site scripting (XSS) vulnerability in Site title"
}

GHSA-VF9V-CP45-WPQ2

Vulnerability from github – Published: 2024-06-04 12:31 – Updated: 2024-06-04 12:31
VLAI
Details

Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in ARI Soft ARI Stream Quiz allows Code Injection.This issue affects ARI Stream Quiz: from n/a through 1.3.2.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-47513"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-80"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-06-04T10:15:11Z",
    "severity": "MODERATE"
  },
  "details": "Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in ARI Soft ARI Stream Quiz allows Code Injection.This issue affects ARI Stream Quiz: from n/a through 1.3.2.",
  "id": "GHSA-vf9v-cp45-wpq2",
  "modified": "2024-06-04T12:31:03Z",
  "published": "2024-06-04T12:31:03Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-47513"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/vulnerability/ari-stream-quiz/wordpress-ari-stream-quiz-wordpress-quizzes-builder-plugin-1-2-32-content-injection-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation
Implementation

Carefully check each input parameter against a rigorous positive specification (allowlist) defining the specific characters and format allowed. All input should be neutralized, not just parameters that the user is supposed to specify, but all data in the request, including hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. We often encounter data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.

Mitigation MIT-30.1
Implementation

Strategy: Output Encoding

  • Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
  • The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
Mitigation MIT-43
Implementation

With Struts, write all data from form beans with the bean's filter attribute set to true.

Mitigation MIT-31
Implementation

Strategy: Attack Surface Reduction

To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.

CAPEC-18: XSS Targeting Non-Script Elements

This attack is a form of Cross-Site Scripting (XSS) where malicious scripts are embedded in elements that are not expected to host scripts such as image tags (<img>), comments in XML documents (< !-CDATA->), etc. These tags may not be subject to the same input validation, output validation, and other content filtering and checking routines, so this can create an opportunity for an adversary to tunnel through the application's elements and launch a XSS attack through other elements. As with all remote attacks, it is important to differentiate the ability to launch an attack (such as probing an internal network for unpatched servers) and the ability of the remote adversary to collect and interpret the output of said attack.

CAPEC-193: PHP Remote File Inclusion

In this pattern the adversary is able to load and execute arbitrary code remotely available from the application. This is usually accomplished through an insecurely configured PHP runtime environment and an improperly sanitized "include" or "require" call, which the user can then control to point to any web-accessible file. This allows adversaries to hijack the targeted application and force it to execute their own instructions.

CAPEC-32: XSS Through HTTP Query Strings

An adversary embeds malicious script code in the parameters of an HTTP query string and convinces a victim to submit the HTTP request that contains the query string to a vulnerable web application. The web application then procedes to use the values parameters without properly validation them first and generates the HTML code that will be executed by the victim's browser.

CAPEC-86: XSS Through HTTP Headers

An adversary exploits web applications that generate web content, such as links in a HTML page, based on unvalidated or improperly validated data submitted by other actors. XSS in HTTP Headers attacks target the HTTP headers which are hidden from most users and may not be validated by web applications.