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.
Published: 2026-02-27
Score: 6.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Stored XSS via unescaped violation messages
Action: Apply Patch
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Tue, 03 Mar 2026 21:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 03 Mar 2026 18:45:00 +0000

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

Mon, 02 Mar 2026 12:15:00 +0000

Type Values Removed Values Added
First Time appeared Pmd
Pmd pmd
Vendors & Products Pmd
Pmd pmd

Fri, 27 Feb 2026 20:45:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-03-03T20:26:01.369Z

Reserved: 2026-02-26T18:38:13.889Z

Link: CVE-2026-28338

cve-icon Vulnrichment

Updated: 2026-03-03T20:25:58.288Z

cve-icon NVD

Status : Analyzed

Published: 2026-02-27T21:16:19.017

Modified: 2026-03-03T18:43:33.240

Link: CVE-2026-28338

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-17T14:00:15Z

Weaknesses