CVE-2026-28338 PMD Designer has Stored XSS in VBHTMLRenderer and YAHTMLRenderer via unescaped violation messages

Medium 6.8 Published Updated

Attackers can execute arbitrary JavaScript in browsers by crafting source code analyzed by PMD using legacy HTML report formats.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-28338?

CVE-2026-28338 is a medium-severity cross-site scripting vulnerability in pmd, published on 27 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-79

Which versions are affected by CVE-2026-28338?

2 open source packages ship an affected version, including net.sourceforge.pmd:pmd-core. It affects 1 product.

PackageAffectedFixed in
net.sourceforge.pmd:pmd-core MavenAll versions7.22.0
net.sourceforge.pmd:pmd-core MavenAll versions7.22.0

Products include Pmd Project Pmd.

How do I fix CVE-2026-28338?

Upgrade net.sourceforge.pmd:pmd-core to 7.22.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-28338 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-28338 exists.

Sources

Also known as GHSA-8rr6-2qw5-pc7r.

Is CVE-2026-28338 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free