[packages/libraptor2] Rel 6. Fix heap overflow in language tags and two parser bugs.
arekm
arekm at pld-linux.org
Thu Nov 26 09:19:51 CET 2026
commit 955116bdeb2c40c38e0e20f2d603b960070be594
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Nov 26 00:29:08 2026 +0100
Rel 6. Fix heap overflow in language tags and two parser bugs.
Fixes CVE-2025-71436, CVE-2024-57823, CVE-2024-57822.
libraptor2.spec | 8 +++++++-
raptor2-CVE-2024-57822.patch | 13 +++++++++++++
raptor2-CVE-2024-57823.patch | 26 ++++++++++++++++++++++++++
raptor2-CVE-2025-71436.patch | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 83 insertions(+), 1 deletion(-)
---
diff --git a/libraptor2.spec b/libraptor2.spec
index 06b7976..f969f21 100644
--- a/libraptor2.spec
+++ b/libraptor2.spec
@@ -4,12 +4,15 @@ Name: libraptor2
# the real name is raptor2, but it follows libraptor (named as such because raptor was already occupied)
%define rname raptor2
Version: 2.0.16
-Release: 5
+Release: 6
License: LGPL v2.1+ or GPL v2+ or Apache v2.0+
Group: Libraries
Source0: https://download.librdf.org/source/%{rname}-%{version}.tar.gz
# Source0-md5: 0a71f13b6eaa0a04bf411083d89d7bc2
Patch0: %{rname}-libxml2.patch
+Patch1: %{rname}-CVE-2024-57822.patch
+Patch2: %{rname}-CVE-2024-57823.patch
+Patch3: %{rname}-CVE-2025-71436.patch
URL: https://librdf.org/raptor/
BuildRequires: autoconf >= 2.62
BuildRequires: automake >= 1:1.11
@@ -99,6 +102,9 @@ Testowy program parsera Raptor RDF.
%prep
%setup -q -n %{rname}-%{version}
%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
%build
%{__libtoolize}
diff --git a/raptor2-CVE-2024-57822.patch b/raptor2-CVE-2024-57822.patch
new file mode 100644
index 0000000..6881c73
--- /dev/null
+++ b/raptor2-CVE-2024-57822.patch
@@ -0,0 +1,13 @@
+# CVE-2024-57822: heap over-read on empty bnode id in N-Triples parser (upstream commit ece2c79d)
+diff --git a/src/raptor_ntriples.c b/src/raptor_ntriples.c
+--- a/src/raptor_ntriples.c
++++ b/src/raptor_ntriples.c
+@@ -212,7 +212,7 @@ raptor_ntriples_parse_term_internal(raptor_world* world,
+ locator->column--;
+ locator->byte--;
+ }
+- if(term_class == RAPTOR_TERM_CLASS_BNODEID && dest[-1] == '.') {
++ if(term_class == RAPTOR_TERM_CLASS_BNODEID && position > 0 && dest[-1] == '.') {
+ /* If bnode id ended on '.' move back one */
+ dest--;
+
diff --git a/raptor2-CVE-2024-57823.patch b/raptor2-CVE-2024-57823.patch
new file mode 100644
index 0000000..60ce9f4
--- /dev/null
+++ b/raptor2-CVE-2024-57823.patch
@@ -0,0 +1,26 @@
+# CVE-2024-57823: integer underflow in raptor_uri_normalize_path (upstream commit da7a7997)
+diff --git a/src/raptor_rfc2396.c b/src/raptor_rfc2396.c
+--- a/src/raptor_rfc2396.c
++++ b/src/raptor_rfc2396.c
+@@ -351,6 +351,10 @@ raptor_uri_normalize_path(unsigned char* path_buffer, size_t path_len)
+ *dest++ = *s++;
+ *dest = '\0';
+ path_len -= len;
++ if(path_len <= 0) {
++ *path_buffer = '\0';
++ return 0;
++ }
+
+ if(p && p < prev) {
+ /* We know the previous prev path component and we didn't do
+@@ -390,6 +394,10 @@ raptor_uri_normalize_path(unsigned char* path_buffer, size_t path_len)
+ /* Remove <component>/.. at the end of the path */
+ *prev = '\0';
+ path_len -= (s-prev);
++ if(path_len <= 0) {
++ *path_buffer = '\0';
++ return 0;
++ }
+ }
+
+
diff --git a/raptor2-CVE-2025-71436.patch b/raptor2-CVE-2025-71436.patch
new file mode 100644
index 0000000..e269045
--- /dev/null
+++ b/raptor2-CVE-2025-71436.patch
@@ -0,0 +1,37 @@
+# CVE-2025-71436: language tag length truncated to unsigned char, heap overflow (upstream issue 83, commit 361a803a, term.c part)
+--- raptor2-2.0.16.orig/src/raptor_term.c 2026-11-26 00:27:27.443333333 +0100
++++ raptor2-2.0.16/src/raptor_term.c 2026-11-26 00:27:28.026939622 +0100
+@@ -201,6 +201,7 @@
+ if(language) {
+ unsigned char c;
+ unsigned char* l;
++ size_t i;
+
+ new_language = RAPTOR_MALLOC(unsigned char*, language_len + 1);
+ if(!new_language) {
+@@ -209,12 +210,13 @@
+ }
+
+ l = new_language;
+- while((c = *language++)) {
++ for(i = 0; i < language_len && (c = language[i]); i++) {
+ if(c == '_')
+ c = '-';
+ *l++ = c;
+ }
+ *l = '\0';
++ language_len = RAPTOR_GOOD_CAST(unsigned char, l - new_language);
+ } else
+ language_len = 0;
+
+@@ -281,6 +283,10 @@
+ if(language)
+ language_len = strlen(RAPTOR_GOOD_CAST(const char*, language));
+
++ /* language_len is passed on as an unsigned char */
++ if(language_len > 255)
++ return NULL;
++
+ return raptor_new_term_from_counted_literal(world, literal, literal_len,
+ datatype, language,
+ RAPTOR_BAD_CAST(unsigned char, language_len));
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libraptor2.git/commitdiff/955116bdeb2c40c38e0e20f2d603b960070be594
More information about the pld-cvs-commit
mailing list