Medium

HTML Injection in preact

  • Disclosed: 02.09.2020
  • Updated: 11.10.2026 10:22

Versions of preact 10.x on prerelease tags alpha and beta prior to 10.0.0-beta.1 are vulnerable to HTML Injection. Due to insufficient input validation the package allows attackers to inject JavaScript objects as virtual-dom nodes, which may lead to Cross-Site Scripting. This requires user input parsed with JSON.parse() to be passed directly into JSX without sanitization.

Recommendation

Upgrade to version 10.0.0-beta.1.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package preact >= 10.0.0-alpha.0, < 10.0.0-beta.1 10.0.0-beta.1

References

CVSS score -
Weakness (CWE)
CWE-74
Platform
npm
Package
preact
Disclosed
02.09.2020
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-cg48-9hh2-x6mx - CC BY 4.0

Vulnerability history: preact

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
09.2020 01.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 1

Disclosures per year

  1. 2020: 1
  2. 2021: 0
  3. 2022: 0
  4. 2023: 0
  5. 2024: 0
  6. 2025: 0
  7. 2026: 1
  1. High CVE-2026-22028 >= 10.26.5, < 10.26.10, >= 10.27.0, < 10.27.3, >= 10.28.0, < 10.28.2 10.26.10, 10.27.3, 10.28.2
  2. HTML Injection in preact this entry
    Medium ghsa-cg48-9hh2-x6mx >= 10.0.0-alpha.0, < 10.0.0-beta.1 10.0.0-beta.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.