123456789_123456789_123456789_123456789_123456789_

Nokogiri Changelog

Nokogiri followsSemantic Versioning](https://semver.org/), please see the [README.md for details.


next / unreleased

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.14.6, from v2.13.8. libxml2 v2.14 includes changes to more closely adhere to the HTML5 parser spec. Notably, the content of iframe and noframes tags is now treated as raw text, where previously it was parsed as PCDATA.

Improved

Changed

Fixed

v1.19.4 / 2026-06-18

Security

*CRuby] (Low) Fixed a possible invalid memory read when XML::Node#initialize_copy_with_args is called with an argument that is not a Node. See [GHSA-g9g8-vgvw-g3vf for more information. *CRuby] (Low) Fixed a possible use-after-free when an XML::XPathContext is used after its source document has been garbage collected. See [GHSA-p67v-3w7g-wjg7 for more information. *CRuby] (Low) Fixed a possible use-after-free during XInclude processing via Node#do_xinclude. See [GHSA-wfpw-mmfh-qq69 for more information. *CRuby] (Low) Fixed a possible use-after-free when Document#root= is assigned a non-element node. See [GHSA-wjv4-x9w8-wm3h for more information. *CRuby] (Low) Fixed a possible use-after-free when setting an attribute value via XML::Attr#value= or #content=. See [GHSA-phwj-rprq-35pp for more information. *CRuby] (Low) Fixed a null pointer dereference when methods are called on uninitialized wrapper objects (e.g. via allocate); these now raise instead of crashing the process. See [GHSA-9cv2-cfxc-v4v2 for more information. *CRuby] (Low) Fixed a possible use-after-free when Document#encoding= raises an exception. See [GHSA-5v8h-3h3q-446p for more information. *CRuby] (Medium) Fixed an out-of-bounds read in XML::NodeSet#[] (alias #slice) when given a large negative index. See [GHSA-5prr-v3j2-97mh for more information. *JRuby] (Low) XML::Schema now enforces the NONET parse option, which Nokogiri enables by default. It was not enforced on JRuby, so a schema parsed with default options could still fetch external resources over the network, potentially enabling SSRF or XXE attacks and bypassing the mitigation for CVE-2020-26247. See [GHSA-8678-w3jw-xfc2 for more information.

v1.19.3 / 2026-04-27

Fixed / Security

v1.19.2 / 2026-03-19

Dependencies

v1.19.1 / 2026-02-16

Security

*CRuby] Address unchecked return value from xmlC14NExecute which was a contributing cause to ruby-saml GHSA-x4h9-gwv3-r4m4. See [GHSA-wx95-c6cv-8532 for more information.

v1.19.0 / 2025-12-28

Ruby

This release is focused on changes to Ruby version support, and is otherwise functionally identical to v1.18.10.

v1.18.10 / 2025-09-15

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.13.9. Note that the security fixes published in v2.13.9 were already present in Nokogiri v1.18.9. *CRuby] [Windows and MacOS] Vendored libiconv is updated to [v1.18

v1.18.9 / 2025-07-20

Security

*CRuby] Applied upstream libxml2 patches to address CVE-2025-6021, CVE-2025-6170, CVE-2025-49794, CVE-2025-49795, and CVE-2025-49796. See [GHSA-353f-x4gh-cqq8 for more information.

v1.18.8 / 2025-04-21

Security

*CRuby] Vendored libxml2 is updated tov2.13.8 to address CVE-2025-32414 and CVE-2025-32415. See [GHSA-5w6v-399v-w3cc for more information.

v1.18.7 / 2025-03-31

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.13.7, which is a bugfix release.

v1.18.6 / 2025-03-24

Fixed

v1.18.5 / 2025-03-19

Fixed

v1.18.4 / 2025-03-14

Security

*CRuby] Vendored libxslt is updated tov1.1.43 to address CVE-2025-24855 and CVE-2024-55549. See [GHSA-mrxw-mxhj-p664 for more information.

v1.18.3 / 2025-02-18

Security

*CRuby] Vendored libxml2 is updatedv2.13.6 to address CVE-2025-24928 and CVE-2024-56171. See [GHSA-vvfq-8hwr-qm4m for more information.

v1.18.2 / 2024-01-19

Fixed

v1.18.1 / 2024-12-29

Fixed

v1.18.0 / 2024-12-25

Notable Changes

Ruby

This release introduces native gem support for Ruby 3.4.

This release ends support for Ruby 3.0, for whichupstream support ended 2024-04-23.

This release ships separate precompiled GNU and Musl gems for all linux platforms. Previously both GNU and Musl target systems could use and install the same gem, e.g., the platform gem for x86_64-linux. Now, however, the precompiled gem platforms would be x86_64-linux-gnu and x86_64-linux-musl. So long as you're on bundler >= 2.5.6 this should be seamless other than perhaps needing to update the platforms in your "Gemfile.lock".

This release drops precompiled native platform gems for x86-linux and x86-mingw32. These platforms are still supported. Users on these platforms must install the "ruby platform" gem which requires a compiler toolchain. SeeInstalling the ruby platform gem in the installation docs. (#3369, #3081)

Improved

Dependencies

v1.17.2 / 2024-12-12

Fixed

v1.17.1 / 2024-12-10

Fixed

v1.17.0 / 2024-12-08

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.13.5. @flavorjones *CRuby] Vendored libxslt is updated to [v1.1.42. @flavorjones

Notable changes

SAX Parsers

The XML and HTML4 SAX parsers have received a lot of attention in this release, and we've fixed multiple long-standing bugs with encoding and entity handling. In addition, libxml2 v2.13 has also made some underlying fixes and improvements to encoding and entity handling.

We're shipping these fixes in a minor release because we firmly believe the resulting behavior is correct and standards-compliant, however applications that have been depending on the buggy behavior may be impacted.

If your application relies on the SAX parsers, and in particular if you're SAX-parsing documents with parsed entities or incorrect encoding declarations, please read the changelog below carefully.

Fragment parsing

Document fragment parsing has been improved, particularly with respect to handling malformed fragments or fragments with implicit namespace prefixes. Namespace reconciliation still isn't where we want it to be, but it's an improvement.

HTML5 fragment parsing now allows the context node to be specified as a context: keyword argument to the HTML5::DocumentFragment.parse and .new methods, which should allow for more flexible sanitization and future support for thedraft HTML Sanitizer API in downstream libraries.

Error handling

In scenarios where multiple errors could be reported by the underlying parser, the errors will be aggregated into a single ::Nokogiri::XML::SyntaxError that is raised. Previously only the final error reported by libxml2 was raised (which was often misleading if it was only a warning and not the fatal error).

Schema validation

We've resolved many long-standing bugs in the various schema classes, validation methods, and their error reporting. Behavior is now consistent across schema types and input types, as well as parser backends (Xerces and libxml2).

Keyword arguments

The following methods now accept keyword arguments in addition to positional arguments, and use ... parameter forwarding when possible: HTML4(), HTML4.fragment, HTML4.parse, HTML4::Document.parse, HTML4::DocumentFragment#initialize, HTML4::DocumentFragment.parse, HTML5(), HTML5.fragment, HTML5.parse, HTML5::Document.parse, HTML5::Document.read_io, HTML5::Document.read_memory, HTML5::DocumentFragment#initialize, HTML5::DocumentFragment.parse, XML(), XML.fragment, XML.parse, XML::Document.parse, XML::DocumentFragment#initialize, XML::DocumentFragment.parse, XML::Node#canonicalize, XML::Node.parse, XML::Reader(), XML::RelaxNG(), XML::RelaxNG.new, XML::RelaxNG.read_memory, XML::SAX::PushParser#initialize, XML::Schema(), XML::Schema.new, XML::Schema.read_memory, and XSLT().

Special thanks to those contributors who participated in the RubyConf 2024 Hack Day to work on #3323 to help modernize Nokogiri by adding keyword arguments and using parameter forwarding in many methods, and expanding some of the documentation! We intend to continue adding keyword argument support to more methods. #3323 #3324 #3326 #3327 #3329 #3330 #3332 #3333 #3334 #3335 #3336 #3342 #3355 #3356 @infews @matiasow @MattJones @mononoken @openbl @flavorjones

Added

Improved

Fixed

Changed

Deprecated

Thank you!

The following people and organizations were kind enough to sponsor @flavorjones or the Nokogiri project during the development of v1.17.0:

We'd also like to thank @github who donate a ton of compute time for our CI pipelines!

v1.16.8 / 2024-12-02

Fixed

v1.16.7 / 2024-07-27

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.9, which the upstream release notes state is a security release to address CVE-2024-40896. Nokogiri's maintainers believe this vulnerability does not affect users of Nokogiri, but we advise upgrading at your earliest convenience anyway.

v1.16.6 / 2024-06-13

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.8, which the release notes state is a bugfix release.

v1.16.5

Security

*CRuby] Vendored libxml2 is updated to address CVE-2024-34459. See [GHSA-r95h-9x8f-r3f7 for more information.

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.7 from v2.12.6. (@flavorjones)

v1.16.4 / 2024-04-10

Dependencies

*CRuby] Vendored zlib in the precompiled native gems is updated tov1.3.1 from v1.3. Nokogiri is not affected by the minizip CVE patched in this version, but this update may satisfy some security scanners. Related, see [this discussion about removing the compression libraries altogether in a future version of Nokogiri.

v1.16.3 / 2024-03-15

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.6 from v2.12.5. (@flavorjones)

Changed

v1.16.2 / 2024-02-04

Security

*CRuby] Vendored libxml2 is updated to address CVE-2024-25062. See [GHSA-xc9x-jj77-9p9j for more information.

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.5 from v2.12.4. (@flavorjones)

v1.16.1 / 2024-02-03

Dependencies

*CRuby] Vendored libxml2 is updated to [v2.12.4 from v2.12.3. (@flavorjones)

Fixed

v1.16.0 / 2023-12-27

Notable Changes

Ruby

This release introduces native gem support for Ruby 3.3.

This release ends support for Ruby 2.7, for whichupstream support ended 2023-03-31.

Pattern matching

This version marks official support for the pattern matching API in XML::Attr, XML::Document, XML::DocumentFragment, XML::Namespace, XML::Node, and XML::NodeSet (and their subclasses), originally introduced as an experimental feature in v1.14.0. (@flavorjones)

Documentation on what can be matched:

*XML::Attr#deconstruct_keys</a> *XML::Document#deconstruct_keys</a> *XML::Namespace#deconstruct_keys</a> *XML::Node#deconstruct_keys</a> *XML::DocumentFragment#deconstruct</a> *XML::NodeSet#deconstruct</a>

Dependencies

Fixed

Removed

Thank you!

The following people and organizations were kind enough to sponsor @flavorjones or the Nokogiri project during the development of v1.16.0:

We'd also like to thank @github who donate a ton of compute time for our CI pipelines!

Older releases

Seemisc/CHANGELOG-archive.md