nokogiri 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5f5da7cc1a450e2f45a78d1d505dbb335f4e7d93
4
- data.tar.gz: 9608185d33a04d96176a26d94acb4d06d4ed6c47
2
+ SHA256:
3
+ metadata.gz: b8a0b2422e8eb44142a8f8c1c0a0443b844db2a9d73c66bba59f239d800be9da
4
+ data.tar.gz: eee2e520dd02954386e3b3c83b02ff9fcb12339edcfc9aaf124835badd9b3239
5
5
  SHA512:
6
- metadata.gz: 61749f45c042c9c983e01a578b3a26e7a91a915d92b53481d369da507d7199873694a9ae3638a9e2c628877df2c1694f83ca7a3e4b82f0e60360fc2da8db1979
7
- data.tar.gz: 15818dd921a0f9ba125f447e366153e67e2ed67a309ec76870facbb4a4196061c139e2e1818797c385220cdc8a3bd714b564e31bacc535e31c7969c8f1d70d07
6
+ metadata.gz: c967b49cdb174560fc8519d3e7e7252e4d3bd6e7fde2d13e3b052a9c050291e6ea375cb039fbb96ab9599516bf1dba33e3d606175c08a7db07e4c1abc1f16d4a
7
+ data.tar.gz: ff74b9432fddaff768ba2bda7547461c86ec65133b9c1818a178b75d4db603d1a200204a95e16c5b7fc563f39d2210446ddcf9d18a8eeb4939d597b957074b26
@@ -1,3 +1,16 @@
1
+ # 1.8.5 / 2018-10-04
2
+
3
+ ## Security Notes
4
+
5
+ [MRI] Pulled in upstream patches from libxml2 that address CVE-2018-14404 and CVE-2018-14567. Full details are available in [#1785](https://github.com/sparklemotion/nokogiri/issues/1785). Note that these patches are not yet (as of 2018-10-04) in an upstream release of libxml2.
6
+
7
+
8
+ ## Bug fixes
9
+
10
+ * [MRI] Fix regression in installation when building against system libraries, where some systems would not be able to find libxml2 or libxslt when present. (Regression introduced in v1.8.3.) [#1722]
11
+ * [JRuby] Fix node reparenting when the destination doc is empty. [#1773]
12
+
13
+
1
14
  # 1.8.4 / 2018-07-03
2
15
 
3
16
  ## Bug fixes
@@ -251,6 +251,8 @@ lib/xercesImpl.jar
251
251
  lib/xml-apis.jar
252
252
  lib/xsd/xmlparser/nokogiri.rb
253
253
  patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
254
+ patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch
255
+ patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch
254
256
  patches/sort-patches-by-date
255
257
  suppressions/README.txt
256
258
  suppressions/nokogiri_ruby-2.supp
@@ -434,7 +434,7 @@ end
434
434
 
435
435
  if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
436
436
  $CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
437
- $CFLAGS << " -Wall -Wcast-qual -Wwrite-strings -Wextra -Wmissing-noreturn -Winline"
437
+ $CFLAGS << " -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline"
438
438
  end
439
439
 
440
440
  case
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.8.4'
3
+ VERSION = '1.8.5'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -0,0 +1,54 @@
1
+ From a436374994c47b12d5de1b8b1d191a098fa23594 Mon Sep 17 00:00:00 2001
2
+ From: Nick Wellnhofer <wellnhofer@aevum.de>
3
+ Date: Mon, 30 Jul 2018 12:54:38 +0200
4
+ Subject: [PATCH] Fix nullptr deref with XPath logic ops
5
+
6
+ If the XPath stack is corrupted, for example by a misbehaving extension
7
+ function, the "and" and "or" XPath operators could dereference NULL
8
+ pointers. Check that the XPath stack isn't empty and optimize the
9
+ logic operators slightly.
10
+
11
+ Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/5
12
+
13
+ Also see
14
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
15
+ https://bugzilla.redhat.com/show_bug.cgi?id=1595985
16
+
17
+ This is CVE-2018-14404.
18
+
19
+ Thanks to Guy Inbar for the report.
20
+ ---
21
+ xpath.c | 10 ++++------
22
+ 1 file changed, 4 insertions(+), 6 deletions(-)
23
+
24
+ diff --git a/xpath.c b/xpath.c
25
+ index 3fae0bf..5e3bb9f 100644
26
+ --- a/xpath.c
27
+ +++ b/xpath.c
28
+ @@ -13234,9 +13234,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
29
+ return(0);
30
+ }
31
+ xmlXPathBooleanFunction(ctxt, 1);
32
+ - arg1 = valuePop(ctxt);
33
+ - arg1->boolval &= arg2->boolval;
34
+ - valuePush(ctxt, arg1);
35
+ + if (ctxt->value != NULL)
36
+ + ctxt->value->boolval &= arg2->boolval;
37
+ xmlXPathReleaseObject(ctxt->context, arg2);
38
+ return (total);
39
+ case XPATH_OP_OR:
40
+ @@ -13252,9 +13251,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
41
+ return(0);
42
+ }
43
+ xmlXPathBooleanFunction(ctxt, 1);
44
+ - arg1 = valuePop(ctxt);
45
+ - arg1->boolval |= arg2->boolval;
46
+ - valuePush(ctxt, arg1);
47
+ + if (ctxt->value != NULL)
48
+ + ctxt->value->boolval |= arg2->boolval;
49
+ xmlXPathReleaseObject(ctxt->context, arg2);
50
+ return (total);
51
+ case XPATH_OP_EQUAL:
52
+ --
53
+ 2.17.1
54
+
@@ -0,0 +1,50 @@
1
+ From 2240fbf5912054af025fb6e01e26375100275e74 Mon Sep 17 00:00:00 2001
2
+ From: Nick Wellnhofer <wellnhofer@aevum.de>
3
+ Date: Mon, 30 Jul 2018 13:14:11 +0200
4
+ Subject: [PATCH] Fix infinite loop in LZMA decompression
5
+ MIME-Version: 1.0
6
+ Content-Type: text/plain; charset=UTF-8
7
+ Content-Transfer-Encoding: 8bit
8
+
9
+ Check the liblzma error code more thoroughly to avoid infinite loops.
10
+
11
+ Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13
12
+ Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914
13
+
14
+ This is CVE-2018-9251 and CVE-2018-14567.
15
+
16
+ Thanks to Dongliang Mu and Simon Wörner for the reports.
17
+ ---
18
+ xzlib.c | 9 +++++++++
19
+ 1 file changed, 9 insertions(+)
20
+
21
+ diff --git a/xzlib.c b/xzlib.c
22
+ index a839169..0ba88cf 100644
23
+ --- a/xzlib.c
24
+ +++ b/xzlib.c
25
+ @@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
26
+ "internal error: inflate stream corrupt");
27
+ return -1;
28
+ }
29
+ + /*
30
+ + * FIXME: Remapping a couple of error codes and falling through
31
+ + * to the LZMA error handling looks fragile.
32
+ + */
33
+ if (ret == Z_MEM_ERROR)
34
+ ret = LZMA_MEM_ERROR;
35
+ if (ret == Z_DATA_ERROR)
36
+ @@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
37
+ xz_error(state, LZMA_PROG_ERROR, "compression error");
38
+ return -1;
39
+ }
40
+ + if ((state->how != GZIP) &&
41
+ + (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
42
+ + xz_error(state, ret, "lzma error");
43
+ + return -1;
44
+ + }
45
+ } while (strm->avail_out && ret != LZMA_STREAM_END);
46
+
47
+ /* update available output and crc check value */
48
+ --
49
+ 2.17.1
50
+
@@ -197,6 +197,17 @@ module Nokogiri
197
197
  end
198
198
  end
199
199
 
200
+ describe "given the new document is empty" do
201
+ it "adds the node to the new document" do
202
+ doc1 = Nokogiri::XML.parse("<value>3</value>")
203
+ doc2 = Nokogiri::XML::Document.new
204
+ node = doc1.at_xpath("//value")
205
+ node.remove
206
+ doc2.add_child(node)
207
+ assert_match /<value>3<\/value>/, doc2.to_xml
208
+ end
209
+ end
210
+
200
211
  describe "given a parent node with a default namespace" do
201
212
  before do
202
213
  @doc = Nokogiri::XML(<<-eoxml)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.4
4
+ version: 1.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2018-07-03 00:00:00.000000000 Z
17
+ date: 2018-10-05 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: mini_portile2
@@ -433,6 +433,8 @@ files:
433
433
  - lib/nokogiri/xslt/stylesheet.rb
434
434
  - lib/xsd/xmlparser/nokogiri.rb
435
435
  - patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
436
+ - patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch
437
+ - patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch
436
438
  - patches/sort-patches-by-date
437
439
  - ports/archives/libxml2-2.9.8.tar.gz
438
440
  - ports/archives/libxslt-1.1.32.tar.gz
@@ -572,7 +574,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
572
574
  version: '0'
573
575
  requirements: []
574
576
  rubyforge_project:
575
- rubygems_version: 2.6.12
577
+ rubygems_version: 2.7.7
576
578
  signing_key:
577
579
  specification_version: 4
578
580
  summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser