parse5
8.1.1 · 7 Nov 2026MIT254.7M / weekRepositoryHomepagenpmAtom feed
Upgrading parse5 From 6.0.1 to 8.1.1
11 releases in betweennotes for 10
Reading releases, release notes and advisories…
- 11+
- changes to make
- 0
- advisories fixed
- 15+
- new
- 15+
- fixes
Counted from 10 of 11 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
- 8.1.1
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.fromCodePointthen 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-xmlneeds 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 editsencodingmid-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.
adoptAttributesrebuilt 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
selectortemplateselected an HTML mode; aTypeErrorfollowed 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.
Release by release
- 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.fromCodePointthen 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.
- Security
- 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
- New
- New
tokenizer: Use String.fromCharCode for BMP characters
- New
Use Uint8Array bitmaps for faster tag ID lookups
- New
- New
Switch to ESM-only
- New
Bump to 8.0.0
- New
- Fixed
Fix broken links to documentation
- Fixed
Account for undefined in element stack
- Fixed
- Fixed
Export tree adapter types as namespace to support TS4.x
- Fixed
- 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
- New
- New
Add CJS build of
parser-stream
- New
5 other lines we could not sort, mostly version bumps
- 8.0.1
Revert "perf: use Uint8Array bitmaps for faster tag ID lookups"
- 7.3.0
Bump dependencies
- 7.1.2
Export
ERRasErrorCodes - 7.1.2
Properly handle CR when peeking
- 7.1.0
Improved code coverage
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.