poppler: fix CVE-2025-50420

An issue in the pdfseparate utility of freedesktop poppler
v25.04.0 allows attackers to cause an infinite recursion via
supplying a crafted PDF file. This can lead to a Denial of
Service (DoS).

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2025-50420

Upstream patch:
https://gitlab.freedesktop.org/poppler/poppler/-/commit/a7025904e3330dd6cf95f3664ef6fc77034cc5e1

Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
Yogita Urade
2025-08-18 15:58:37 +05:30
committed by Gyorgy Sarvari
parent 0c7a5712be
commit 244f64762e
2 changed files with 39 additions and 0 deletions
@@ -0,0 +1,38 @@
From a7025904e3330dd6cf95f3664ef6fc77034cc5e1 Mon Sep 17 00:00:00 2001
From: Sune Vuorela <sune@vuorela.dk>
Date: Tue, 29 Jul 2025 14:14:00 +0200
Subject: [PATCH] Fix crash in pdfseparate
Don't continue recursing in PDFDoc::mark* if things looks a bit weirder
than expected
CVE: CVE-2025-50420
Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/a7025904e3330dd6cf95f3664ef6fc77034cc5e1]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
poppler/PDFDoc.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 20bb191..c2e90be 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -1771,6 +1771,15 @@ bool PDFDoc::markAnnotations(Object *annotsObj, XRef *xRef, XRef *countRef, unsi
if (obj1.isDict()) {
Dict *dict = obj1.getDict();
Object type = dict->lookup("Type");
+ if (type.isNull()) {
+ Object subType = dict->lookup("SubType");
+ // Type is optional, subtype is required
+ // If neither of them exists, something is probably
+ // weird here, so let us just skip this entry
+ if (subType.isNull()) {
+ continue;
+ }
+ }
if (type.isName() && strcmp(type.getName(), "Annot") == 0) {
const Object &obj2 = dict->lookupNF("P");
if (obj2.isRef()) {
--
2.40.0
@@ -14,6 +14,7 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
file://CVE-2025-32364.patch \
file://CVE-2025-32365.patch \
file://CVE-2025-43903.patch \
file://CVE-2025-50420.patch \
"
SRC_URI[sha256sum] = "813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff"