# GHSA-cg48-9hh2-x6mx: HTML Injection in preact

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-02T18:28:58.000Z
- Modified: 2021-09-27T20:53:56.000Z
- Weaknesses: CWE-74

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- preact (npm): from 10.0.0-alpha.0 before 10.0.0-beta.1

## References

- <https://github.com/developit/preact/pull/1528> (web)
- <https://github.com/developit/preact> (package)
- <https://github.com/developit/preact/releases/tag/10.0.0-beta.1> (web)
- <https://medium.com/dailyjs/exploiting-script-injection-flaws-in-reactjs-883fb1fe36c1> (web)
- <https://www.npmjs.com/advisories/835> (web)

## Sources

- GitHub Advisory Database: [GHSA-cg48-9hh2-x6mx](https://github.com/advisories/GHSA-cg48-9hh2-x6mx), CC-BY-4.0, modified 2021-09-27

---

Page: https://cve.day/GHSA-cg48-9hh2-x6mx · Whole record: https://cve.day/GHSA-cg48-9hh2-x6mx.json · Rebuilt by cve.day 2026-11-25T22:56:45.087Z
