nokogiri 1.18.9 → 1.18.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dependencies.yml +12 -23
- data/ext/nokogiri/extconf.rb +1 -1
- data/lib/nokogiri/version/constant.rb +1 -1
- data/ports/archives/libxml2-2.13.9.tar.xz +0 -0
- metadata +2 -6
- data/patches/libxml2/0020-CVE-2025-6021-tree-Fix-integer-overflow-in-xmlBuildQ.patch +0 -54
- data/patches/libxml2/0021-CVE-2025-6170-Fix-potential-buffer-overflows-of-inte.patch +0 -102
- data/patches/libxml2/0022-CVE-2025-49795-schematron-Fix-null-pointer-dereferen.patch +0 -69
- data/patches/libxml2/0023-CVE-2025-49794-CVE-2025-49796-schematron-Fix-xmlSche.patch +0 -182
- data/ports/archives/libxml2-2.13.8.tar.xz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1e8dcf8179f9ecf0ca485763ccdf7812d2b47981322e6e7dbc37e62e7b47c07
|
4
|
+
data.tar.gz: ec1c063738afa3d4c3c3d80933449f8479c3b460d0b7ddbd9937c3815c8e0822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74caac3cdcd54f3674ac5a1f3d62e045e0751d6ac39c99bf7e736a8cf52e501c050f84e3906e34a380e12bf5ab4ba7336ef649ec8ec76bc171db10fffce4e44a
|
7
|
+
data.tar.gz: 9b767aa90cfabf02cfdafafbde63cdf373fb0d5ac4d6454bc61c1ddbc2bde6d693b3c174502dada08d615486ba6606f1a2a38a1d050620b24448b3da744cc421
|
data/dependencies.yml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
---
|
2
2
|
libxml2:
|
3
|
-
version: "2.13.
|
4
|
-
sha256: "
|
5
|
-
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.
|
3
|
+
version: "2.13.9"
|
4
|
+
sha256: "a2c9ae7b770da34860050c309f903221c67830c86e4a7e760692b803df95143a"
|
5
|
+
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.9.sha256sum
|
6
6
|
|
7
7
|
libxslt:
|
8
8
|
version: "1.1.43"
|
@@ -15,28 +15,17 @@ zlib:
|
|
15
15
|
# SHA-256 hash provided on http://zlib.net/
|
16
16
|
|
17
17
|
libiconv:
|
18
|
-
|
19
|
-
sha256: "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313"
|
20
|
-
# signature verified by following this path:
|
21
|
-
# - release announced at https://savannah.gnu.org/forum/forum.php?forum_id=10175
|
22
|
-
# - which links to https://savannah.gnu.org/users/haible as the releaser
|
23
|
-
# - which links to https://savannah.gnu.org/people/viewgpg.php?user_id=1871 as the gpg key
|
24
|
-
#
|
25
|
-
# So:
|
26
|
-
# - wget -q -O - https://savannah.gnu.org/people/viewgpg.php?user_id=1871 | gpg --import
|
27
|
-
# gpg: key F5BE8B267C6A406D: 1 signature not checked due to a missing key
|
18
|
+
# $ gpg --keyserver keyserver.ubuntu.com --recv 9001B85AF9E1B83DF1BDA942F5BE8B267C6A406D
|
28
19
|
# gpg: key F5BE8B267C6A406D: public key "Bruno Haible (Open Source Development) <bruno@clisp.org>" imported
|
29
20
|
# gpg: Total number processed: 1
|
30
21
|
# gpg: imported: 1
|
31
|
-
#
|
32
|
-
# gpg:
|
33
|
-
# gpg: next trustdb check due at 2024-05-09
|
34
|
-
# - gpg --verify libiconv-1.17.tar.gz.sig ports/archives/libiconv-1.17.tar.gz
|
35
|
-
# gpg: Signature made Sun 15 May 2022 11:26:42 AM EDT
|
22
|
+
# $ gpg --verify libiconv-1.18.tar.gz.sig ports/archives/libiconv-1.18.tar.gz
|
23
|
+
# gpg: Signature made Sun 15 Dec 2024 07:26:18 AM EST
|
36
24
|
# gpg: using RSA key 9001B85AF9E1B83DF1BDA942F5BE8B267C6A406D
|
37
|
-
# gpg: Good signature from "Bruno Haible (Open Source Development) <bruno@clisp.org>" [
|
38
|
-
# gpg:
|
39
|
-
# gpg: There is no indication that the signature belongs to the owner.
|
25
|
+
# gpg: Good signature from "Bruno Haible (Open Source Development) <bruno@clisp.org>" [expired]
|
26
|
+
# gpg: Note: This key has expired!
|
40
27
|
# Primary key fingerprint: 9001 B85A F9E1 B83D F1BD A942 F5BE 8B26 7C6A 406D
|
41
|
-
#
|
42
|
-
#
|
28
|
+
# $ sha256sum ports/archives/libiconv-1.18.tar.gz
|
29
|
+
# 3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8 ports/archives/libiconv-1.18.tar.gz
|
30
|
+
version: "1.18"
|
31
|
+
sha256: "3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8"
|
data/ext/nokogiri/extconf.rb
CHANGED
@@ -832,7 +832,7 @@ else
|
|
832
832
|
cross_build_p,
|
833
833
|
) do |recipe|
|
834
834
|
recipe.files = [{
|
835
|
-
url: "https://
|
835
|
+
url: "https://ftpmirror.gnu.org/gnu/libiconv/#{recipe.name}-#{recipe.version}.tar.gz",
|
836
836
|
sha256: dependencies["libiconv"]["sha256"],
|
837
837
|
}]
|
838
838
|
|
Binary file
|
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.18.
|
4
|
+
version: 1.18.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -272,12 +272,8 @@ files:
|
|
272
272
|
- patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
|
273
273
|
- patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
|
274
274
|
- patches/libxml2/0019-xpath-Use-separate-static-hash-table-for-standard-fu.patch
|
275
|
-
- patches/libxml2/0020-CVE-2025-6021-tree-Fix-integer-overflow-in-xmlBuildQ.patch
|
276
|
-
- patches/libxml2/0021-CVE-2025-6170-Fix-potential-buffer-overflows-of-inte.patch
|
277
|
-
- patches/libxml2/0022-CVE-2025-49795-schematron-Fix-null-pointer-dereferen.patch
|
278
|
-
- patches/libxml2/0023-CVE-2025-49794-CVE-2025-49796-schematron-Fix-xmlSche.patch
|
279
275
|
- patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
|
280
|
-
- ports/archives/libxml2-2.13.
|
276
|
+
- ports/archives/libxml2-2.13.9.tar.xz
|
281
277
|
- ports/archives/libxslt-1.1.43.tar.xz
|
282
278
|
homepage: https://nokogiri.org
|
283
279
|
licenses:
|
@@ -1,54 +0,0 @@
|
|
1
|
-
From 17d950ae33c23f87692aa179bacedb6743f3188a Mon Sep 17 00:00:00 2001
|
2
|
-
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
3
|
-
Date: Tue, 27 May 2025 12:53:17 +0200
|
4
|
-
Subject: [PATCH 5/9] [CVE-2025-6021] tree: Fix integer overflow in
|
5
|
-
xmlBuildQName
|
6
|
-
|
7
|
-
Fixes #926.
|
8
|
-
---
|
9
|
-
tree.c | 12 +++++++++---
|
10
|
-
1 file changed, 9 insertions(+), 3 deletions(-)
|
11
|
-
|
12
|
-
diff --git a/tree.c b/tree.c
|
13
|
-
index f097cf87..5bc95b8a 100644
|
14
|
-
--- a/tree.c
|
15
|
-
+++ b/tree.c
|
16
|
-
@@ -47,6 +47,10 @@
|
17
|
-
#include "private/error.h"
|
18
|
-
#include "private/tree.h"
|
19
|
-
|
20
|
-
+#ifndef SIZE_MAX
|
21
|
-
+ #define SIZE_MAX ((size_t)-1)
|
22
|
-
+#endif
|
23
|
-
+
|
24
|
-
int __xmlRegisterCallbacks = 0;
|
25
|
-
|
26
|
-
/************************************************************************
|
27
|
-
@@ -167,10 +171,10 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
|
28
|
-
xmlChar *
|
29
|
-
xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
|
30
|
-
xmlChar *memory, int len) {
|
31
|
-
- int lenn, lenp;
|
32
|
-
+ size_t lenn, lenp;
|
33
|
-
xmlChar *ret;
|
34
|
-
|
35
|
-
- if (ncname == NULL) return(NULL);
|
36
|
-
+ if ((ncname == NULL) || (len < 0)) return(NULL);
|
37
|
-
if (prefix == NULL) return((xmlChar *) ncname);
|
38
|
-
|
39
|
-
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
40
|
-
@@ -181,8 +185,10 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
|
41
|
-
|
42
|
-
lenn = strlen((char *) ncname);
|
43
|
-
lenp = strlen((char *) prefix);
|
44
|
-
+ if (lenn >= SIZE_MAX - lenp - 1)
|
45
|
-
+ return(NULL);
|
46
|
-
|
47
|
-
- if ((memory == NULL) || (len < lenn + lenp + 2)) {
|
48
|
-
+ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
|
49
|
-
ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2);
|
50
|
-
if (ret == NULL)
|
51
|
-
return(NULL);
|
52
|
-
--
|
53
|
-
2.50.1
|
54
|
-
|
@@ -1,102 +0,0 @@
|
|
1
|
-
From 5e9ec5c107d3f5b5179c3dbc19df43df041cd55b Mon Sep 17 00:00:00 2001
|
2
|
-
From: Michael Mann <mmann78@netscape.net>
|
3
|
-
Date: Fri, 20 Jun 2025 23:05:00 -0400
|
4
|
-
Subject: [PATCH 6/9] [CVE-2025-6170] Fix potential buffer overflows of
|
5
|
-
interactive shell
|
6
|
-
|
7
|
-
Fixes #941
|
8
|
-
---
|
9
|
-
debugXML.c | 15 ++++++++++-----
|
10
|
-
result/scripts/long_command | 8 ++++++++
|
11
|
-
test/scripts/long_command.script | 6 ++++++
|
12
|
-
test/scripts/long_command.xml | 1 +
|
13
|
-
4 files changed, 25 insertions(+), 5 deletions(-)
|
14
|
-
create mode 100644 result/scripts/long_command
|
15
|
-
create mode 100644 test/scripts/long_command.script
|
16
|
-
create mode 100644 test/scripts/long_command.xml
|
17
|
-
|
18
|
-
diff --git a/debugXML.c b/debugXML.c
|
19
|
-
index ed56b0f8..452b9573 100644
|
20
|
-
--- a/debugXML.c
|
21
|
-
+++ b/debugXML.c
|
22
|
-
@@ -1033,6 +1033,10 @@ xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
|
23
|
-
xmlCtxtGenericNodeCheck(ctxt, node);
|
24
|
-
}
|
25
|
-
|
26
|
-
+#define MAX_PROMPT_SIZE 500
|
27
|
-
+#define MAX_ARG_SIZE 400
|
28
|
-
+#define MAX_COMMAND_SIZE 100
|
29
|
-
+
|
30
|
-
/**
|
31
|
-
* xmlCtxtDumpNode:
|
32
|
-
* @output: the FILE * for the output
|
33
|
-
@@ -2795,10 +2799,10 @@ void
|
34
|
-
xmlShell(xmlDocPtr doc, const char *filename, xmlShellReadlineFunc input,
|
35
|
-
FILE * output)
|
36
|
-
{
|
37
|
-
- char prompt[500] = "/ > ";
|
38
|
-
+ char prompt[MAX_PROMPT_SIZE] = "/ > ";
|
39
|
-
char *cmdline = NULL, *cur;
|
40
|
-
- char command[100];
|
41
|
-
- char arg[400];
|
42
|
-
+ char command[MAX_COMMAND_SIZE];
|
43
|
-
+ char arg[MAX_ARG_SIZE];
|
44
|
-
int i;
|
45
|
-
xmlShellCtxtPtr ctxt;
|
46
|
-
xmlXPathObjectPtr list;
|
47
|
-
@@ -2856,7 +2860,8 @@ xmlShell(xmlDocPtr doc, const char *filename, xmlShellReadlineFunc input,
|
48
|
-
cur++;
|
49
|
-
i = 0;
|
50
|
-
while ((*cur != ' ') && (*cur != '\t') &&
|
51
|
-
- (*cur != '\n') && (*cur != '\r')) {
|
52
|
-
+ (*cur != '\n') && (*cur != '\r') &&
|
53
|
-
+ (i < (MAX_COMMAND_SIZE - 1))) {
|
54
|
-
if (*cur == 0)
|
55
|
-
break;
|
56
|
-
command[i++] = *cur++;
|
57
|
-
@@ -2871,7 +2876,7 @@ xmlShell(xmlDocPtr doc, const char *filename, xmlShellReadlineFunc input,
|
58
|
-
while ((*cur == ' ') || (*cur == '\t'))
|
59
|
-
cur++;
|
60
|
-
i = 0;
|
61
|
-
- while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
|
62
|
-
+ while ((*cur != '\n') && (*cur != '\r') && (*cur != 0) && (i < (MAX_ARG_SIZE-1))) {
|
63
|
-
if (*cur == 0)
|
64
|
-
break;
|
65
|
-
arg[i++] = *cur++;
|
66
|
-
diff --git a/result/scripts/long_command b/result/scripts/long_command
|
67
|
-
new file mode 100644
|
68
|
-
index 00000000..e6f00708
|
69
|
-
--- /dev/null
|
70
|
-
+++ b/result/scripts/long_command
|
71
|
-
@@ -0,0 +1,8 @@
|
72
|
-
+/ > b > b > Object is a Node Set :
|
73
|
-
+Set contains 1 nodes:
|
74
|
-
+1 ELEMENT a:c
|
75
|
-
+b > Unknown command This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_comm
|
76
|
-
+b > b > Unknown command ess_currents_of_time_and_existence
|
77
|
-
+b > <?xml version="1.0"?>
|
78
|
-
+<a xmlns:a="bar"><b xmlns:a="foo">Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_prof</b></a>
|
79
|
-
+b >
|
80
|
-
|
81
|
-
diff --git a/test/scripts/long_command.script b/test/scripts/long_command.script
|
82
|
-
new file mode 100644
|
83
|
-
index 00000000..00f6df09
|
84
|
-
--- /dev/null
|
85
|
-
+++ b/test/scripts/long_command.script
|
86
|
-
@@ -0,0 +1,6 @@
|
87
|
-
+cd a/b
|
88
|
-
+set <a:c/>
|
89
|
-
+xpath //*[namespace-uri()="foo"]
|
90
|
-
+This_is_a_really_long_command_string_designed_to_test_the_limits_of_the_memory_that_stores_the_command_please_dont_crash foo
|
91
|
-
+set Navigating_the_labyrinthine_corridors_of_human_cognition_one_often_encounters_the_perplexing_paradox_that_the_more_we_delve_into_the_intricate_dance_of_neural_pathways_and_synaptic_firings_the_further_we_seem_to_stray_from_a_truly_holistic_understanding_of_consciousness_a_phenomenon_that_remains_as_elusive_as_a_moonbeam_caught_in_a_spiderweb_yet_undeniably_shapes_every_fleeting_thought_every_profound_emotion_and_every_grand_aspiration_that_propels_our_species_ever_onward_through_the_relentless_currents_of_time_and_existence
|
92
|
-
+save -
|
93
|
-
diff --git a/test/scripts/long_command.xml b/test/scripts/long_command.xml
|
94
|
-
new file mode 100644
|
95
|
-
index 00000000..1ba44016
|
96
|
-
--- /dev/null
|
97
|
-
+++ b/test/scripts/long_command.xml
|
98
|
-
@@ -0,0 +1 @@
|
99
|
-
+<a xmlns:a="bar"><b xmlns:a="foo"/></a>
|
100
|
-
--
|
101
|
-
2.50.1
|
102
|
-
|
@@ -1,69 +0,0 @@
|
|
1
|
-
From 62048278a4c5fdf14d287dfb400005c0a0caa69f Mon Sep 17 00:00:00 2001
|
2
|
-
From: Michael Mann <mmann78@netscape.net>
|
3
|
-
Date: Sat, 21 Jun 2025 12:11:30 -0400
|
4
|
-
Subject: [PATCH 7/9] [CVE-2025-49795] schematron: Fix null pointer dereference
|
5
|
-
leading to DoS
|
6
|
-
|
7
|
-
Fixes #932
|
8
|
-
---
|
9
|
-
result/schematron/zvon16_0.err | 3 +++
|
10
|
-
schematron.c | 5 +++++
|
11
|
-
test/schematron/zvon16.sct | 7 +++++++
|
12
|
-
test/schematron/zvon16_0.xml | 5 +++++
|
13
|
-
4 files changed, 20 insertions(+)
|
14
|
-
create mode 100644 result/schematron/zvon16_0.err
|
15
|
-
create mode 100644 test/schematron/zvon16.sct
|
16
|
-
create mode 100644 test/schematron/zvon16_0.xml
|
17
|
-
|
18
|
-
diff --git a/result/schematron/zvon16_0.err b/result/schematron/zvon16_0.err
|
19
|
-
new file mode 100644
|
20
|
-
index 00000000..3d052409
|
21
|
-
--- /dev/null
|
22
|
-
+++ b/result/schematron/zvon16_0.err
|
23
|
-
@@ -0,0 +1,3 @@
|
24
|
-
+XPath error : Unregistered function
|
25
|
-
+./test/schematron/zvon16_0.xml:2: element book: schematron error : /library/book line 2: Book
|
26
|
-
+./test/schematron/zvon16_0.xml fails to validate
|
27
|
-
diff --git a/schematron.c b/schematron.c
|
28
|
-
index 1de25deb..da603402 100644
|
29
|
-
--- a/schematron.c
|
30
|
-
+++ b/schematron.c
|
31
|
-
@@ -1506,6 +1506,11 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
32
|
-
select = xmlGetNoNsProp(child, BAD_CAST "select");
|
33
|
-
comp = xmlXPathCtxtCompile(ctxt->xctxt, select);
|
34
|
-
eval = xmlXPathCompiledEval(comp, ctxt->xctxt);
|
35
|
-
+ if (eval == NULL) {
|
36
|
-
+ xmlXPathFreeCompExpr(comp);
|
37
|
-
+ xmlFree(select);
|
38
|
-
+ return ret;
|
39
|
-
+ }
|
40
|
-
|
41
|
-
switch (eval->type) {
|
42
|
-
case XPATH_NODESET: {
|
43
|
-
diff --git a/test/schematron/zvon16.sct b/test/schematron/zvon16.sct
|
44
|
-
new file mode 100644
|
45
|
-
index 00000000..f03848aa
|
46
|
-
--- /dev/null
|
47
|
-
+++ b/test/schematron/zvon16.sct
|
48
|
-
@@ -0,0 +1,7 @@
|
49
|
-
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
50
|
-
+ <sch:pattern id="TestPattern">
|
51
|
-
+ <sch:rule context="book">
|
52
|
-
+ <sch:report test="not(@available)">Book <sch:value-of select="falae()"/> test</sch:report>
|
53
|
-
+ </sch:rule>
|
54
|
-
+ </sch:pattern>
|
55
|
-
+</sch:schema>
|
56
|
-
diff --git a/test/schematron/zvon16_0.xml b/test/schematron/zvon16_0.xml
|
57
|
-
new file mode 100644
|
58
|
-
index 00000000..551e2d65
|
59
|
-
--- /dev/null
|
60
|
-
+++ b/test/schematron/zvon16_0.xml
|
61
|
-
@@ -0,0 +1,5 @@
|
62
|
-
+<library>
|
63
|
-
+ <book title="Test Book" id="bk101">
|
64
|
-
+ <author>Test Author</author>
|
65
|
-
+ </book>
|
66
|
-
+</library>
|
67
|
-
--
|
68
|
-
2.50.1
|
69
|
-
|
@@ -1,182 +0,0 @@
|
|
1
|
-
From 81cef8c5b5aec2acdf5707e57a6db0c8d1d0abca Mon Sep 17 00:00:00 2001
|
2
|
-
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
3
|
-
Date: Fri, 4 Jul 2025 14:28:26 +0200
|
4
|
-
Subject: [PATCH 8/9] [CVE-2025-49794] [CVE-2025-49796] schematron: Fix
|
5
|
-
xmlSchematronReportOutput
|
6
|
-
|
7
|
-
Fix use-after-free (CVE-2025-49794) and type confusion (CVE-2025-49796)
|
8
|
-
in xmlSchematronReportOutput.
|
9
|
-
|
10
|
-
Fixes #931.
|
11
|
-
Fixes #933.
|
12
|
-
---
|
13
|
-
result/schematron/cve-2025-49794_0.err | 2 ++
|
14
|
-
result/schematron/cve-2025-49796_0.err | 2 ++
|
15
|
-
schematron.c | 49 ++++++++++++++------------
|
16
|
-
test/schematron/cve-2025-49794.sct | 10 ++++++
|
17
|
-
test/schematron/cve-2025-49794_0.xml | 6 ++++
|
18
|
-
test/schematron/cve-2025-49796.sct | 9 +++++
|
19
|
-
test/schematron/cve-2025-49796_0.xml | 3 ++
|
20
|
-
7 files changed, 58 insertions(+), 23 deletions(-)
|
21
|
-
create mode 100644 result/schematron/cve-2025-49794_0.err
|
22
|
-
create mode 100644 result/schematron/cve-2025-49796_0.err
|
23
|
-
create mode 100644 test/schematron/cve-2025-49794.sct
|
24
|
-
create mode 100644 test/schematron/cve-2025-49794_0.xml
|
25
|
-
create mode 100644 test/schematron/cve-2025-49796.sct
|
26
|
-
create mode 100644 test/schematron/cve-2025-49796_0.xml
|
27
|
-
|
28
|
-
diff --git a/result/schematron/cve-2025-49794_0.err b/result/schematron/cve-2025-49794_0.err
|
29
|
-
new file mode 100644
|
30
|
-
index 00000000..57752310
|
31
|
-
--- /dev/null
|
32
|
-
+++ b/result/schematron/cve-2025-49794_0.err
|
33
|
-
@@ -0,0 +1,2 @@
|
34
|
-
+./test/schematron/cve-2025-49794_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
35
|
-
+./test/schematron/cve-2025-49794_0.xml fails to validate
|
36
|
-
diff --git a/result/schematron/cve-2025-49796_0.err b/result/schematron/cve-2025-49796_0.err
|
37
|
-
new file mode 100644
|
38
|
-
index 00000000..bf875ee0
|
39
|
-
--- /dev/null
|
40
|
-
+++ b/result/schematron/cve-2025-49796_0.err
|
41
|
-
@@ -0,0 +1,2 @@
|
42
|
-
+./test/schematron/cve-2025-49796_0.xml:2: element boo0: schematron error : /librar0/boo0 line 2:
|
43
|
-
+./test/schematron/cve-2025-49796_0.xml fails to validate
|
44
|
-
diff --git a/schematron.c b/schematron.c
|
45
|
-
index da603402..6e2ceeb7 100644
|
46
|
-
--- a/schematron.c
|
47
|
-
+++ b/schematron.c
|
48
|
-
@@ -1414,27 +1414,15 @@ xmlSchematronParse(xmlSchematronParserCtxtPtr ctxt)
|
49
|
-
* *
|
50
|
-
************************************************************************/
|
51
|
-
|
52
|
-
-static xmlNodePtr
|
53
|
-
+static xmlXPathObjectPtr
|
54
|
-
xmlSchematronGetNode(xmlSchematronValidCtxtPtr ctxt,
|
55
|
-
xmlNodePtr cur, const xmlChar *xpath) {
|
56
|
-
- xmlNodePtr node = NULL;
|
57
|
-
- xmlXPathObjectPtr ret;
|
58
|
-
-
|
59
|
-
if ((ctxt == NULL) || (cur == NULL) || (xpath == NULL))
|
60
|
-
return(NULL);
|
61
|
-
|
62
|
-
ctxt->xctxt->doc = cur->doc;
|
63
|
-
ctxt->xctxt->node = cur;
|
64
|
-
- ret = xmlXPathEval(xpath, ctxt->xctxt);
|
65
|
-
- if (ret == NULL)
|
66
|
-
- return(NULL);
|
67
|
-
-
|
68
|
-
- if ((ret->type == XPATH_NODESET) &&
|
69
|
-
- (ret->nodesetval != NULL) && (ret->nodesetval->nodeNr > 0))
|
70
|
-
- node = ret->nodesetval->nodeTab[0];
|
71
|
-
-
|
72
|
-
- xmlXPathFreeObject(ret);
|
73
|
-
- return(node);
|
74
|
-
+ return(xmlXPathEval(xpath, ctxt->xctxt));
|
75
|
-
}
|
76
|
-
|
77
|
-
/**
|
78
|
-
@@ -1480,25 +1468,40 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
|
79
|
-
(child->type == XML_CDATA_SECTION_NODE))
|
80
|
-
ret = xmlStrcat(ret, child->content);
|
81
|
-
else if (IS_SCHEMATRON(child, "name")) {
|
82
|
-
+ xmlXPathObject *obj = NULL;
|
83
|
-
xmlChar *path;
|
84
|
-
|
85
|
-
path = xmlGetNoNsProp(child, BAD_CAST "path");
|
86
|
-
|
87
|
-
node = cur;
|
88
|
-
if (path != NULL) {
|
89
|
-
- node = xmlSchematronGetNode(ctxt, cur, path);
|
90
|
-
- if (node == NULL)
|
91
|
-
- node = cur;
|
92
|
-
+ obj = xmlSchematronGetNode(ctxt, cur, path);
|
93
|
-
+ if ((obj != NULL) &&
|
94
|
-
+ (obj->type == XPATH_NODESET) &&
|
95
|
-
+ (obj->nodesetval != NULL) &&
|
96
|
-
+ (obj->nodesetval->nodeNr > 0))
|
97
|
-
+ node = obj->nodesetval->nodeTab[0];
|
98
|
-
xmlFree(path);
|
99
|
-
}
|
100
|
-
|
101
|
-
- if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
102
|
-
- ret = xmlStrcat(ret, node->name);
|
103
|
-
- else {
|
104
|
-
- ret = xmlStrcat(ret, node->ns->prefix);
|
105
|
-
- ret = xmlStrcat(ret, BAD_CAST ":");
|
106
|
-
- ret = xmlStrcat(ret, node->name);
|
107
|
-
+ switch (node->type) {
|
108
|
-
+ case XML_ELEMENT_NODE:
|
109
|
-
+ case XML_ATTRIBUTE_NODE:
|
110
|
-
+ if ((node->ns == NULL) || (node->ns->prefix == NULL))
|
111
|
-
+ ret = xmlStrcat(ret, node->name);
|
112
|
-
+ else {
|
113
|
-
+ ret = xmlStrcat(ret, node->ns->prefix);
|
114
|
-
+ ret = xmlStrcat(ret, BAD_CAST ":");
|
115
|
-
+ ret = xmlStrcat(ret, node->name);
|
116
|
-
+ }
|
117
|
-
+ break;
|
118
|
-
+
|
119
|
-
+ /* TODO: handle other node types */
|
120
|
-
+ default:
|
121
|
-
+ break;
|
122
|
-
}
|
123
|
-
+
|
124
|
-
+ xmlXPathFreeObject(obj);
|
125
|
-
} else if (IS_SCHEMATRON(child, "value-of")) {
|
126
|
-
xmlChar *select;
|
127
|
-
xmlXPathObjectPtr eval;
|
128
|
-
diff --git a/test/schematron/cve-2025-49794.sct b/test/schematron/cve-2025-49794.sct
|
129
|
-
new file mode 100644
|
130
|
-
index 00000000..7fc9ee3d
|
131
|
-
--- /dev/null
|
132
|
-
+++ b/test/schematron/cve-2025-49794.sct
|
133
|
-
@@ -0,0 +1,10 @@
|
134
|
-
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
135
|
-
+ <sch:pattern id="">
|
136
|
-
+ <sch:rule context="boo0">
|
137
|
-
+ <sch:report test="not(0)">
|
138
|
-
+ <sch:name path="	e|namespace::*|e"/>
|
139
|
-
+ </sch:report>
|
140
|
-
+ <sch:report test="0"></sch:report>
|
141
|
-
+ </sch:rule>
|
142
|
-
+ </sch:pattern>
|
143
|
-
+</sch:schema>
|
144
|
-
diff --git a/test/schematron/cve-2025-49794_0.xml b/test/schematron/cve-2025-49794_0.xml
|
145
|
-
new file mode 100644
|
146
|
-
index 00000000..debc64ba
|
147
|
-
--- /dev/null
|
148
|
-
+++ b/test/schematron/cve-2025-49794_0.xml
|
149
|
-
@@ -0,0 +1,6 @@
|
150
|
-
+<librar0>
|
151
|
-
+ <boo0 t="">
|
152
|
-
+ <author></author>
|
153
|
-
+ </boo0>
|
154
|
-
+ <ins></ins>
|
155
|
-
+</librar0>
|
156
|
-
diff --git a/test/schematron/cve-2025-49796.sct b/test/schematron/cve-2025-49796.sct
|
157
|
-
new file mode 100644
|
158
|
-
index 00000000..e9702d75
|
159
|
-
--- /dev/null
|
160
|
-
+++ b/test/schematron/cve-2025-49796.sct
|
161
|
-
@@ -0,0 +1,9 @@
|
162
|
-
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
|
163
|
-
+ <sch:pattern id="">
|
164
|
-
+ <sch:rule context="boo0">
|
165
|
-
+ <sch:report test="not(0)">
|
166
|
-
+ <sch:name path="/"/>
|
167
|
-
+ </sch:report>
|
168
|
-
+ </sch:rule>
|
169
|
-
+ </sch:pattern>
|
170
|
-
+</sch:schema>
|
171
|
-
diff --git a/test/schematron/cve-2025-49796_0.xml b/test/schematron/cve-2025-49796_0.xml
|
172
|
-
new file mode 100644
|
173
|
-
index 00000000..be33c4ec
|
174
|
-
--- /dev/null
|
175
|
-
+++ b/test/schematron/cve-2025-49796_0.xml
|
176
|
-
@@ -0,0 +1,3 @@
|
177
|
-
+<librar0>
|
178
|
-
+ <boo0/>
|
179
|
-
+</librar0>
|
180
|
-
--
|
181
|
-
2.50.1
|
182
|
-
|
Binary file
|