Vulnerability library
Security checkJanuary 09, 2023

HTML Injection in preact

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmpreact

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

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

Update the preact package to the latest compatible version. Followings are version details:

  • Affected version(s): >= 10.0.0-alpha.0, <= 10.0.0-beta.0
  • Patched version(s): 10.0.0-beta.1

References

Could your website be exposed too?

SmartScanner can check your website for HTML Injection in preact and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated January 09, 2023