Packages

parse5

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

Upgrading parse5 From 5.1.1 to 8.1.1

13 releases in betweennotes for 12

Reading releases, release notes and advisories…

  1. 5.1.1yours
  2. 6.0.0major
  3. 1 release
  4. 7.0.0major
  5. 6 releases
  6. 8.0.0major
  7. 2 releases
  8. 8.1.1target
11+
changes to make
0
advisories fixed
16+
new
15+
fixes

Counted from 12 of 13 release notes. Advisories are counted from the advisory database, in full.

Before you upgrade

Tick each one off as you go
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0
  • Breaking7.0.0

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

  5. 7.3.0

    22 Apr 20252 fixes
    • Fixed

      Fix broken links to documentation

    • Fixed

      Account for undefined in element stack

  6. 7.2.1

    28 Oct 20241 fix
    • Fixed

      Export tree adapter types as namespace to support TS4.x

  7. 7.2.0

    12 Oct 20242 new · 3 fixes
    • New

      parser: Support search element

    • New

      parse5: Change parser/tokenizer methods to be protected

    • Fixed

      Don't generate sourcemap on build, close #831

    • Fixed

      Fix <noframes> parsing

    • Fixed

      Use typedoc config to avoid accidental inheritance

  8. 7.1.2

    20 Nov 20221 new
    • New

      Add CJS build of parser-stream

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

    8.0.1
  • Bump dependencies

    7.3.0
  • Export ERR as ErrorCodes

    7.1.2
  • Properly handle CR when peeking

    7.1.2
  • Improved code coverage

    7.1.0
  • Fixed: Handling of self-closing <hr> tags

    6.0.1
  • Fixed: Broken link in TreeAdapter document (GH #317)

    6.0.1
  • Fixed: SAXParser example (GH #316)

    6.0.1

386 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.