Skip to content

Commit 6d4677f

Browse files
authored
dep: upgrade Saxon-HE from 9.6.0-4 to 12.7 [v1.19.x backport] (#3614)
## Summary Backport of #3613 to `v1.19.x` for a patch release. - Upgrade Saxon-HE from 9.6.0-4 to 12.7 to address CVEs in transitive dependencies (dom4j, jdom) that trigger false positives in vulnerability scanners - Add Saxon-HE as an explicit gemspec requirement to override the transitive version pinned by nu.validator:jing - Add new transitive dependency org.xmlresolver:xmlresolver 5.3.3 (required by Saxon-HE 12.x) - Fix vendor_jars rake task to correctly handle Maven classifier artifacts (g:a:classifier:v) - Update LICENSE-DEPENDENCIES.md with xmlresolver license (Apache 2.0) Closes #3611 ## Test plan - [x] Full JRuby test suite passes (2005 runs, 0 failures, 0 errors) - [ ] CI green
2 parents d913045 + acf9527 commit 6d4677f

10 files changed

Lines changed: 219 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA
44

55
---
66

7+
## next / unreleased
8+
9+
### Dependencies
10+
11+
* [JRuby] Saxon-HE is updated to 12.7, from 9.6.0-4. This addresses CVEs in transitive dependencies of the older version. (#3611)
12+
13+
14+
715
## v1.19.1 / 2026-02-16
816

917
### Security

LICENSE-DEPENDENCIES.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Note that this document is broken into multiple sections, each of which describe
2525
* [net.sourceforge.htmlunit:neko-htmlunit](#netsourceforgehtmlunitneko-htmlunit)
2626
* [nu.validator:jing](#nuvalidatorjing)
2727
* [org.nokogiri:nekodtd](#orgnokogirinekodtd)
28+
* [org.xmlresolver:xmlresolver](#orgxmlresolverxmlresolver)
2829
* [xalan:serializer and xalan:xalan](#xalanserializer-and-xalanxalan)
2930
* [xerces:xercesImpl](#xercesxercesimpl)
3031
* [xml-apis:xml-apis](#xml-apisxml-apis)
@@ -98,6 +99,7 @@ The Java platform release distributes the following dependencies as compiled jar
9899
* [net.sourceforge.htmlunit:neko-htmlunit](#netsourceforgehtmlunitneko-htmlunit)
99100
* [nu.validator:jing](#nuvalidatorjing)
100101
* [org.nokogiri:nekodtd](#orgnokogirinekodtd)
102+
* [org.xmlresolver:xmlresolver](#orgxmlresolverxmlresolver)
101103
* [xalan:serializer and xalan:xalan](#xalanserializer-and-xalanxalan)
102104
* [xerces:xercesImpl](#xercesxercesimpl)
103105
* [xml-apis:xml-apis](#xml-apisxml-apis)
@@ -1661,6 +1663,191 @@ https://github.com/sparklemotion/nekodtd
16611663
END OF TERMS AND CONDITIONS
16621664

16631665

1666+
### org.xmlresolver:xmlresolver
1667+
1668+
Apache 2.0
1669+
1670+
https://xmlresolver.org/
1671+
1672+
Apache License
1673+
Version 2.0, January 2004
1674+
http://www.apache.org/licenses/
1675+
1676+
1677+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1678+
1679+
1. Definitions.
1680+
1681+
"License" shall mean the terms and conditions for use, reproduction,
1682+
and distribution as defined by Sections 1 through 9 of this document.
1683+
1684+
"Licensor" shall mean the copyright owner or entity authorized by
1685+
the copyright owner that is granting the License.
1686+
1687+
"Legal Entity" shall mean the union of the acting entity and all
1688+
other entities that control, are controlled by, or are under common
1689+
control with that entity. For the purposes of this definition,
1690+
"control" means (i) the power, direct or indirect, to cause the
1691+
direction or management of such entity, whether by contract or
1692+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
1693+
outstanding shares, or (iii) beneficial ownership of such entity.
1694+
1695+
"You" (or "Your") shall mean an individual or Legal Entity
1696+
exercising permissions granted by this License.
1697+
1698+
"Source" form shall mean the preferred form for making modifications,
1699+
including but not limited to software source code, documentation
1700+
source, and configuration files.
1701+
1702+
"Object" form shall mean any form resulting from mechanical
1703+
transformation or translation of a Source form, including but
1704+
not limited to compiled object code, generated documentation,
1705+
and conversions to other media types.
1706+
1707+
"Work" shall mean the work of authorship, whether in Source or
1708+
Object form, made available under the License, as indicated by a
1709+
copyright notice that is included in or attached to the work
1710+
(an example is provided in the Appendix below).
1711+
1712+
"Derivative Works" shall mean any work, whether in Source or Object
1713+
form, that is based on (or derived from) the Work and for which the
1714+
editorial revisions, annotations, elaborations, or other modifications
1715+
represent, as a whole, an original work of authorship. For the purposes
1716+
of this License, Derivative Works shall not include works that remain
1717+
separable from, or merely link (or bind by name) to the interfaces of,
1718+
the Work and Derivative Works thereof.
1719+
1720+
"Contribution" shall mean any work of authorship, including
1721+
the original version of the Work and any modifications or additions
1722+
to that Work or Derivative Works thereof, that is intentionally
1723+
submitted to Licensor for inclusion in the Work by the copyright owner
1724+
or by an individual or Legal Entity authorized to submit on behalf of
1725+
the copyright owner. For the purposes of this definition, "submitted"
1726+
means any form of electronic, verbal, or written communication sent
1727+
to the Licensor or its representatives, including but not limited to
1728+
communication on electronic mailing lists, source code control systems,
1729+
and issue tracking systems that are managed by, or on behalf of, the
1730+
Licensor for the purpose of discussing and improving the Work, but
1731+
excluding communication that is conspicuously marked or otherwise
1732+
designated in writing by the copyright owner as "Not a Contribution."
1733+
1734+
"Contributor" shall mean Licensor and any individual or Legal Entity
1735+
on behalf of whom a Contribution has been received by Licensor and
1736+
subsequently incorporated within the Work.
1737+
1738+
2. Grant of Copyright License. Subject to the terms and conditions of
1739+
this License, each Contributor hereby grants to You a perpetual,
1740+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1741+
copyright license to reproduce, prepare Derivative Works of,
1742+
publicly display, publicly perform, sublicense, and distribute the
1743+
Work and such Derivative Works in Source or Object form.
1744+
1745+
3. Grant of Patent License. Subject to the terms and conditions of
1746+
this License, each Contributor hereby grants to You a perpetual,
1747+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1748+
(except as stated in this section) patent license to make, have made,
1749+
use, offer to sell, sell, import, and otherwise transfer the Work,
1750+
where such license applies only to those patent claims licensable
1751+
by such Contributor that are necessarily infringed by their
1752+
Contribution(s) alone or by combination of their Contribution(s)
1753+
with the Work to which such Contribution(s) was submitted. If You
1754+
institute patent litigation against any entity (including a
1755+
cross-claim or counterclaim in a lawsuit) alleging that the Work
1756+
or a Contribution incorporated within the Work constitutes direct
1757+
or contributory patent infringement, then any patent licenses
1758+
granted to You under this License for that Work shall terminate
1759+
as of the date such litigation is filed.
1760+
1761+
4. Redistribution. You may reproduce and distribute copies of the
1762+
Work or Derivative Works thereof in any medium, with or without
1763+
modifications, and in Source or Object form, provided that You
1764+
meet the following conditions:
1765+
1766+
(a) You must give any other recipients of the Work or
1767+
Derivative Works a copy of this License; and
1768+
1769+
(b) You must cause any modified files to carry prominent notices
1770+
stating that You changed the files; and
1771+
1772+
(c) You must retain, in the Source form of any Derivative Works
1773+
that You distribute, all copyright, patent, trademark, and
1774+
attribution notices from the Source form of the Work,
1775+
excluding those notices that do not pertain to any part of
1776+
the Derivative Works; and
1777+
1778+
(d) If the Work includes a "NOTICE" text file as part of its
1779+
distribution, then any Derivative Works that You distribute must
1780+
include a readable copy of the attribution notices contained
1781+
within such NOTICE file, excluding those notices that do not
1782+
pertain to any part of the Derivative Works, in at least one
1783+
of the following places: within a NOTICE text file distributed
1784+
as part of the Derivative Works; within the Source form or
1785+
documentation, if provided along with the Derivative Works; or,
1786+
within a display generated by the Derivative Works, if and
1787+
wherever such third-party notices normally appear. The contents
1788+
of the NOTICE file are for informational purposes only and
1789+
do not modify the License. You may add Your own attribution
1790+
notices within Derivative Works that You distribute, alongside
1791+
or as an addendum to the NOTICE text from the Work, provided
1792+
that such additional attribution notices cannot be construed
1793+
as modifying the License.
1794+
1795+
You may add Your own copyright statement to Your modifications and
1796+
may provide additional or different license terms and conditions
1797+
for use, reproduction, or distribution of Your modifications, or
1798+
for any such Derivative Works as a whole, provided Your use,
1799+
reproduction, and distribution of the Work otherwise complies with
1800+
the conditions stated in this License.
1801+
1802+
5. Submission of Contributions. Unless You explicitly state otherwise,
1803+
any Contribution intentionally submitted for inclusion in the Work
1804+
by You to the Licensor shall be under the terms and conditions of
1805+
this License, without any additional terms or conditions.
1806+
Notwithstanding the above, nothing herein shall supersede or modify
1807+
the terms of any separate license agreement you may have executed
1808+
with Licensor regarding such Contributions.
1809+
1810+
6. Trademarks. This License does not grant permission to use the trade
1811+
names, trademarks, service marks, or product names of the Licensor,
1812+
except as required for reasonable and customary use in describing the
1813+
origin of the Work and reproducing the content of the NOTICE file.
1814+
1815+
7. Disclaimer of Warranty. Unless required by applicable law or
1816+
agreed to in writing, Licensor provides the Work (and each
1817+
Contributor provides its Contributions) on an "AS IS" BASIS,
1818+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1819+
implied, including, without limitation, any warranties or conditions
1820+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
1821+
PARTICULAR PURPOSE. You are solely responsible for determining the
1822+
appropriateness of using or redistributing the Work and assume any
1823+
risks associated with Your exercise of permissions under this License.
1824+
1825+
8. Limitation of Liability. In no event and under no legal theory,
1826+
whether in tort (including negligence), contract, or otherwise,
1827+
unless required by applicable law (such as deliberate and grossly
1828+
negligent acts) or agreed to in writing, shall any Contributor be
1829+
liable to You for damages, including any direct, indirect, special,
1830+
incidental, or consequential damages of any character arising as a
1831+
result of this License or out of the use or inability to use the
1832+
Work (including but not limited to damages for loss of goodwill,
1833+
work stoppage, computer failure or malfunction, or any and all
1834+
other commercial damages or losses), even if such Contributor
1835+
has been advised of the possibility of such damages.
1836+
1837+
9. Accepting Warranty or Additional Liability. While redistributing
1838+
the Work or Derivative Works thereof, You may choose to offer,
1839+
and charge a fee for, acceptance of support, warranty, indemnity,
1840+
or other liability obligations and/or rights consistent with this
1841+
License. However, in accepting such obligations, You may act only
1842+
on Your own behalf and on Your sole responsibility, not on behalf
1843+
of any other Contributor, and only if You agree to indemnify,
1844+
defend, and hold each Contributor harmless for any liability
1845+
incurred by, or claims asserted against, such Contributor by reason
1846+
of your accepting any such warranty or additional liability.
1847+
1848+
END OF TERMS AND CONDITIONS
1849+
1850+
16641851
### xalan:serializer and xalan:xalan
16651852

16661853
Apache 2.0
5.51 MB
Binary file not shown.
Binary file not shown.

lib/nokogiri/jruby/nokogiri_jars.rb

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,42 @@
22
begin
33
require 'jar_dependencies'
44
rescue LoadError
5-
require 'xalan/serializer/2.7.3/serializer-2.7.3.jar'
5+
require 'isorelax/isorelax/20030108/isorelax-20030108.jar'
6+
require 'org/nokogiri/nekodtd/0.1.11.noko2/nekodtd-0.1.11.noko2.jar'
67
require 'net/sourceforge/htmlunit/neko-htmlunit/2.63.0/neko-htmlunit-2.63.0.jar'
8+
require 'net/sf/saxon/Saxon-HE/12.7/Saxon-HE-12.7.jar'
9+
require 'org/xmlresolver/xmlresolver/5.3.3/xmlresolver-5.3.3.jar'
10+
require 'org/xmlresolver/xmlresolver/5.3.3/xmlresolver-5.3.3-data.jar'
711
require 'nu/validator/jing/20200702VNU/jing-20200702VNU.jar'
8-
require 'xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.jar'
9-
require 'net/sf/saxon/Saxon-HE/9.6.0-4/Saxon-HE-9.6.0-4.jar'
12+
require 'xalan/serializer/2.7.3/serializer-2.7.3.jar'
1013
require 'xalan/xalan/2.7.3/xalan-2.7.3.jar'
14+
require 'xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.jar'
1115
require 'xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar'
12-
require 'org/nokogiri/nekodtd/0.1.11.noko2/nekodtd-0.1.11.noko2.jar'
13-
require 'isorelax/isorelax/20030108/isorelax-20030108.jar'
1416
end
1517

1618
if defined? Jars
17-
require_jar 'xalan', 'serializer', '2.7.3'
19+
require_jar 'isorelax', 'isorelax', '20030108'
20+
require_jar 'org.nokogiri', 'nekodtd', '0.1.11.noko2'
1821
require_jar 'net.sourceforge.htmlunit', 'neko-htmlunit', '2.63.0'
22+
require_jar 'net.sf.saxon', 'Saxon-HE', '12.7'
23+
require_jar 'org.xmlresolver', 'xmlresolver', '5.3.3'
24+
require_jar 'org.xmlresolver', 'xmlresolver', 'data', '5.3.3'
1925
require_jar 'nu.validator', 'jing', '20200702VNU'
20-
require_jar 'xerces', 'xercesImpl', '2.12.2'
21-
require_jar 'net.sf.saxon', 'Saxon-HE', '9.6.0-4'
26+
require_jar 'xalan', 'serializer', '2.7.3'
2227
require_jar 'xalan', 'xalan', '2.7.3'
28+
require_jar 'xerces', 'xercesImpl', '2.12.2'
2329
require_jar 'xml-apis', 'xml-apis', '1.4.01'
24-
require_jar 'org.nokogiri', 'nekodtd', '0.1.11.noko2'
25-
require_jar 'isorelax', 'isorelax', '20030108'
2630
end
2731

2832
module Nokogiri
2933
# generated by the :vendor_jars rake task
3034
JAR_DEPENDENCIES = {
3135
"isorelax:isorelax" => "20030108",
32-
"net.sf.saxon:Saxon-HE" => "9.6.0-4",
36+
"net.sf.saxon:Saxon-HE" => "12.7",
3337
"net.sourceforge.htmlunit:neko-htmlunit" => "2.63.0",
3438
"nu.validator:jing" => "20200702VNU",
3539
"org.nokogiri:nekodtd" => "0.1.11.noko2",
40+
"org.xmlresolver:xmlresolver" => "5.3.3",
3641
"xalan:serializer" => "2.7.3",
3742
"xalan:xalan" => "2.7.3",
3843
"xerces:xercesImpl" => "2.12.2",
Binary file not shown.
Binary file not shown.

nokogiri.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ Gem::Specification.new do |spec|
314314
"lib/nokogiri/jruby/net/sourceforge/htmlunit/neko-htmlunit/*/neko-htmlunit-*.jar",
315315
"lib/nokogiri/jruby/nu/validator/jing/*/jing-*.jar",
316316
"lib/nokogiri/jruby/org/nokogiri/nekodtd/*/nekodtd-*.jar",
317+
"lib/nokogiri/jruby/org/xmlresolver/xmlresolver/*/xmlresolver-*.jar",
317318
"lib/nokogiri/jruby/xalan/serializer/*/serializer-*.jar",
318319
"lib/nokogiri/jruby/xalan/xalan/*/xalan-*.jar",
319320
"lib/nokogiri/jruby/xerces/xercesImpl/*/xercesImpl-*.jar",
@@ -336,6 +337,7 @@ Gem::Specification.new do |spec|
336337
spec.requirements << "jar isorelax, isorelax, 20030108" # https://search.maven.org/artifact/isorelax/isorelax
337338
spec.requirements << "jar org.nokogiri, nekodtd, 0.1.11.noko2"
338339
spec.requirements << "jar net.sourceforge.htmlunit, neko-htmlunit, 2.63.0"
340+
spec.requirements << "jar net.sf.saxon, Saxon-HE, 12.7" # https://search.maven.org/artifact/net.sf.saxon/Saxon-HE
339341
spec.requirements << "jar nu.validator, jing, 20200702VNU" # https://search.maven.org/artifact/nu.validator/jing
340342
spec.requirements << "jar xalan, serializer, 2.7.3" # https://search.maven.org/artifact/xalan/serializer
341343
spec.requirements << "jar xalan, xalan, 2.7.3" # https://search.maven.org/artifact/xalan/xalan

rakelib/extensions.rake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,11 @@ if java?
349349

350350
jars = Jars::Installer.vendor_jars!("lib/nokogiri/jruby")
351351
jar_dependencies = jars.sort_by(&:gav).each_with_object({}) do |a, d|
352-
g, a, v = a.gav.split(":")
353-
name = [g, a].join(":")
354-
d[name] = v
352+
parts = a.gav.split(":")
353+
group, artifact = parts[0], parts[1]
354+
version = parts.last # handles both g:a:v and g:a:classifier:v
355+
name = [group, artifact].join(":")
356+
d[name] = version
355357
end
356358

357359
# output this to try to minimize git merge conflicts going forward

test/xml/sax/test_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class TestCase
7777

7878
it "parses a compressed file" do
7979
skip("libxml2 legacy support") unless Nokogiri.uses_libxml? && Nokogiri::LIBXML_ZLIB_ENABLED
80-
skip("TODO: windows libxml 2.15.1 system libraries have ZLIB_ENABLED but it's really not") if Nokogiri::VersionInfo.instance.windows? && Nokogiri::VersionInfo.instance.libxml2_using_system?
80+
skip("libxml2 >= 2.15 requires callers to pass XML_PARSE_UNZIP to enable decompression") if Nokogiri.uses_libxml?(">= 2.15.0")
8181

8282
filename = XML_FILE + ".gz"
8383
parser.parse_file(filename)

0 commit comments

Comments
 (0)