Packages

parse5

8.1.1 · 7 Nov 2026MIT254.7M / weekRepositoryHomepagenpmAtom feed

Upgrading parse5 From 7.3.0 to 8.1.1

4 releases in betweenevery note read

Reading releases, release notes and advisories…

The note of 8.0.0 lists no breaking change or deprecation, which is rare for a major.
?
changes to make
0
advisories fixed
8
new
5
fixes

Security

  • There are no CVEs or GitHub security advisories for these issues: private vulnerability reporting on this repository is only accessible to @inikulin.

    8.1.1
  • High: A crash from two code units. A lone low surrogate followed by another low surrogate was decoded as a pair, and String.fromCodePoint then threw out of every parser entry point. Only a high surrogate now starts a pair. Reported by Joshua Rogers and by Anthropic.

    8.1.1
  • High: A crash, also through cheerio's $.html(). Serialization recursed once per DOM level, so a few KB of nesting exhausted the call stack. It now uses an explicit stack, and the output is unchanged byte for byte. Reported by SnailSploit.

    8.1.1
  • High: Quadratic parse time. The SAX parser's namespace stack was shifted from the front for every element, quadratic in the nesting. It is kept at its tail. Reported by iaohkut, José Antonio Zamudio Amaya and Ravindu Lakmina.

    8.1.1
  • High: A crash, and quadratic time before it. Nested templates were closed recursively at EOF, and the template insertion-mode stack was shifted per template. Both are iterative now. Reported by SnailSploit and by the three reporters above.

    8.1.1
  • High: Quadratic parse time. Foster parenting scanned all preceding siblings of the table for every insertion. The reference is found without scanning. Reported by iaohkut, José Antonio Zamudio Amaya and Ravindu Lakmina.

    8.1.1
  • High: 8,002,000 attribute records from 39 KB of input. Integration-point checks read the attribute list of every element, which the htmlparser2 adapter allocates on each call. Only annotation-xml needs it, and its list is now read once per element, as the HTML Standard decides by the start tag (rereading it on every pop took 7 s for 8,000 attributes and children; a script that edits encoding mid-parse no longer changes the verdict, stated in the commit). Reported by Anthropic; the rereads on every pop were found while reviewing this series.

    8.1.1
  • High: 210 ms from 35 KB, growing quadratically. adoptAttributes rebuilt the recipient's name Set for an empty merge, so repeated <html> and <body> tags without attributes were quadratic. It returns early. Tags that each add an attribute rebuilt it too (816 ms for 8,000 <html> tags), so the adapter now keeps the names between merges and re-indexes when the list changed under it; a script that renames an attribute between two merges to a name the cache has never seen is the one documented difference (stated in the commit). Reported by iaohkut, José Antonio Zamudio Amaya and Ravindu Lakmina; the merges that add attributes were found while reviewing this series.

    8.1.1
  • High: A crash and mutation XSS. Resetting the insertion mode matched foreign elements by tag id, so an SVG select or template selected an HTML mode; a TypeError followed from 50 bytes, and a longer shape serialized into an <img onerror> absent from the tree. Foreign elements are skipped. Reported by Anthropic.

    8.1.1
  • High: Quadratic parse time from formatting tags. Formatting tags with distinct attributes (<b a=1><b a=2>…) made every insertion into the list of active formatting elements scan the list for Noah's Ark, and formatting end tags scanned and spliced it. The list is now linked and indexed by tag and by attributes, so insertion costs the tag's attributes and removal and lookup are constant. An attribute group leaves the index with its last entry, so the index does not grow with the distinct attribute sets of the input. Reported by Liyi Zhou, Ziyue Wang, Strick Sheng, Maurice Ng and Chenchen Yu (University of Sydney), and by Anthropic.

    8.1.1

Release by release

  1. 8.1.1

    Security fix7 Nov 20262 fixes
    • Security

      There are no CVEs or GitHub security advisories for these issues: private vulnerability reporting on this repository is only accessible to @inikulin.

    • Security

      High: A crash from two code units. A lone low surrogate followed by another low surrogate was decoded as a pair, and String.fromCodePoint then threw out of every parser entry point. Only a high surrogate now starts a pair. Reported by Joshua Rogers and by Anthropic.

    • Security

      High: A crash, also through cheerio's $.html(). Serialization recursed once per DOM level, so a few KB of nesting exhausted the call stack. It now uses an explicit stack, and the output is unchanged byte for byte. Reported by SnailSploit.

    • Security

      High: Quadratic parse time. The SAX parser's namespace stack was shifted from the front for every element, quadratic in the nesting. It is kept at its tail. Reported by iaohkut, José Antonio Zamudio Amaya and Ravindu Lakmina.

  2. 8.1.0

    1 Nov 20264 new · 3 fixes
    • New

      Expose element creation context to tree adapters

    • New

      Export InsertionMode enum from parse5

    • New

      Allow flushing buffered character tokens

    • New

      tokenizer: Append attribute values and character runs as slices of the input

    • Fixed

      Treat numeric character reference CR as whitespace

    • Fixed

      parser: Match only HTML elements in the "any other end tag" step

    • Fixed

      End attribute names when missing whitespace

  3. 8.0.1

    19 Apr 20262 new
    • New

      tokenizer: Use String.fromCharCode for BMP characters

    • New

      Use Uint8Array bitmaps for faster tag ID lookups

  4. 8.0.0

    9 Jul 20252 new
    • New

      Switch to ESM-only

    • New

      Bump to 8.0.0

1 other line we could not sort, mostly version bumps
  • Revert "perf: use Uint8Array bitmaps for faster tag ID lookups"

    8.0.1

369 internal lines (docs, tests, tooling) left out.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.