CVE-2026-28338

PMD Designer has Stored XSS in VBHTMLRenderer and YAHTMLRenderer via unescaped violation messages

Published Feb 27, 2026 CVSS 3.1 · 6.8 Medium EPSS < 1% KEV · Not listed
Description
PMD is an extensible multilanguage static code analyzer. Prior to version 7.22.0, PMD's `vbhtml` and `yahtml` report formats insert rule violation messages into HTML output without escaping. When PMD analyzes untrusted source code containing crafted string literals, the generated HTML report contains executable JavaScript that runs when opened in a browser. Practical impact is limited because `vbhtml` and `yahtml` are legacy formats rarely used in practice. The default `html` format is properly escaped and not affected. Version 7.22.0 contains a fix for the issue.

Analysis

AI-generated

Technical impact

PMD is a static‑code analysis tool that can output rule violations in several formats. In releases before version 7.22.0 the vbhtml and yahtml reporters inserted violation messages directly into the generated HTML without escaping them. If those reporters process data that contains malicious strings, the resulting report will include executable JavaScript that runs when a user opens the file in a browser. The primary impact is that an attacker who supplies crafted source code and is able to deliver the resulting report to a browser session can run arbitrary code with the privileges of the browser user. Affected systems are installations of PMD before 7.22.0 that use the legacy vbhtml or yahtml report formats. The default html format is not affected, and the legacy formats are rarely used in current environments. The vulnerability is identified as CWE‑79 (Cross‑Site Scripting).

Affected Systems

PMD is a static code analysis tool provided by PMD. The vulnerability affects versions of PMD prior to 7.22.0 that generate code‑analysis reports using the legacy vbhtml or yahtml formats. The root of the issue is the unescaped inclusion of rule violation messages into the generated HTML; any PMD installation that uses these formats to process untrusted source code is at risk. The default html format is escaped and safe, so systems that use only the standard html report format are not impacted.

Risk and Exploitability

Exploitability is limited to a scenario where an attacker supplies malicious source code to PMD, leading the output report to contain executable JavaScript that runs when opened in a browser. The CVSS score of 6.8 indicates moderate severity, but the EPSS score below 1% and absence from the CISA KEV catalog suggest a low likelihood of widespread exploitation. The legacy vbhtml and yahtml reports are rarely used in contemporary environments, further constraining the attack surface. The impact remains significant for systems that still generate or distribute these outdated reports from untrusted code sources.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PMD to version 7.22.0 or newer, which applies proper escaping for all report formats.
  • If upgrading is not possible, cease using the vbhtml or yahtml formats; generate reports only with the html formatter that safely escapes content.
  • When producing reports from untrusted code, explicitly sanitize or escape violation messages before embedding them in HTML to prevent script execution.

Generated by OpenCVE AI on April 17, 2026 at 13:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-8rr6-2qw5-pc7r PMD Designer has Stored XSS in VBHTMLRenderer and YAHTMLRenderer via unescaped violation messages
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pmd Project
Pmd Project pmd
CPEs cpe:2.3:a:pmd_project:pmd:*:*:*:*:*:*:*:*
Vendors & Products Pmd Project
Pmd Project pmd
Type Values Removed Values Added
First Time appeared Pmd
Pmd pmd
Vendors & Products Pmd
Pmd pmd
Type Values Removed Values Added
Description PMD is an extensible multilanguage static code analyzer. Prior to version 7.22.0, PMD's `vbhtml` and `yahtml` report formats insert rule violation messages into HTML output without escaping. When PMD analyzes untrusted source code containing crafted string literals, the generated HTML report contains executable JavaScript that runs when opened in a browser. Practical impact is limited because `vbhtml` and `yahtml` are legacy formats rarely used in practice. The default `html` format is properly escaped and not affected. Version 7.22.0 contains a fix for the issue.
Title PMD Designer has Stored XSS in VBHTMLRenderer and YAHTMLRenderer via unescaped violation messages
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 6.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 3, 2026, 8:26 PM
Reserved
Feb 26, 2026, 6:38 PM
Status
Analyzed
Published
Feb 27, 2026, 9:16 PM
Modified
Jun 17, 2026, 10:28 AM