preact@10.28.1 vulnerabilities

Fast 3kb React-compatible Virtual DOM library.

  • latest version

    10.28.2

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    8 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the preact package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • C
    Access of Resource Using Incompatible Type ('Type Confusion')

    preact is a fast 3kB alternative to React with the same modern API.

    Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') during rendering in the vnode constructor. An attacker can inject arbitrary HTML or execute scripts by supplying specially crafted JSON objects that are incorrectly interpreted as valid VNodes when unsanitized, unvalidated user input is passed directly into the render tree.

    Note:

    This is only exploitable if applications pass unmodified, unsanitized values from user-modifiable data sources directly into the render tree, assume these values are strings while the data source could return JavaScript objects, and the data source fails to perform type sanitization or is compromised.

    ##Workaround

    This vulnerability can be mitigated by validating input types, enforcing strict type contracts at API boundaries, casting or validating network data before rendering, sanitizing external data, and implementing a strict Content Security Policy (CSP) to prevent inline script execution.

    How to fix Access of Resource Using Incompatible Type ('Type Confusion')?

    Upgrade preact to version 10.26.10, 10.27.3, 10.28.2 or higher.

    >=10.26.5 <10.26.10>=10.27.0 <10.27.3>=10.28.0 <10.28.2