npm package report

Is @swc/html safe?

1 known vulnerability, worst severity MODERATE.

// reach

0 direct dependencies

none carry a known advisory

    1 packages depend on it

    an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


    cvss
    0.0
    medium

    severity out of 10

    epss
    0.00%
    low

    chance of exploitation in 30 days, 25th percentile of all CVEs

    xyz score
    not scored

    CyberXYZ composite out of 10

    fig. 01 — GHSA-5qr2-v392-m9g8, the advisory selected below

    // 1 advisories

    GHSA-5qr2-v392-m9g8

    MODERATECVE-2026-72925
    // impact

    @swc/html minifies JSON contained in script elements such as application/json and application/ld+json by parsing and serializing the JSON value.

    Before the patched versions, JSON serialization could convert escaped less-than signs such as \u003C into literal sequence, the generated HTML could terminate the containing script element early because HTML tokenization occurs before the JSON is consumed.

    Applications that minify HTML containing attacker-controlled JSON data could therefore transform inert data into active markup. A crafted payload could execute script in the origin of the generated page.

    // patches

    The issue is fixed in:

    • @swc/html 1.15.47
    • swchtmlminifier 59.0.0

    The minifier now re-escapes less-than signs after JSON serialization, preserving the script element boundary.

    // workarounds

    Users who cannot upgrade can disable JSON minification with:

    await minify(html, {
      minifyJson: false,
    });
    // cvss v3.1 vector

    CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

    Attack vector
    Network
    Attack complexity
    Low
    Privileges required
    None
    User interaction
    Required
    Scope
    Changed
    Confidentiality
    Low
    Integrity
    Low
    Availability
    None

    Checked 2026-10-04 at 02:17 UTC. The most recent advisory here was published 2026-09-08. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.