diff --git a/backport-CVE-2025-52886.patch b/backport-CVE-2025-52886.patch new file mode 100644 index 0000000000000000000000000000000000000000..60575a5b33807ae1da112191977179291d0ba319 --- /dev/null +++ b/backport-CVE-2025-52886.patch @@ -0,0 +1,55 @@ +From ac36affcc8486de38e8905a8d6547a3464ff46e5 Mon Sep 17 00:00:00 2001 +From: Sune Vuorela +Date: Tue, 3 Jun 2025 00:35:19 +0200 +Subject: [PATCH] Limit ammount of annots per document/page + +--- + poppler/Annot.cc | 4 ++++ + poppler/Page.cc | 16 ++++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/poppler/Annot.cc b/poppler/Annot.cc +index c8f029f..9a08947 100644 +--- a/poppler/Annot.cc ++++ b/poppler/Annot.cc +@@ -1673,6 +1673,10 @@ void Annot::removeReferencedObjects() + + void Annot::incRefCnt() + { ++ if (refCnt > 100000) { ++ error(errSyntaxError, -1, "Annotations likely malformed. Too many references. Stopping processing annots on page {0:d}", page); ++ return; ++ } + refCnt++; + } + +diff --git a/poppler/Page.cc b/poppler/Page.cc +index d871110..b367985 100644 +--- a/poppler/Page.cc ++++ b/poppler/Page.cc +@@ -297,6 +297,22 @@ Page::Page(PDFDoc *docA, int numA, Object &&pageDict, Ref pageRefA, PageAttrs *a + goto err2; + } + ++ if (annotsObj.isArray() && annotsObj.arrayGetLength() > 10000) { ++ error(errSyntaxError, -1, "Page annotations object (page {0:d}) is likely malformed. Too big: ({1:d})", num, annotsObj.arrayGetLength()); ++ goto err2; ++ } ++ if (annotsObj.isRef()) { ++ auto resolvedObj = getAnnotsObject(); ++ if (resolvedObj.isArray() && resolvedObj.arrayGetLength() > 10000) { ++ error(errSyntaxError, -1, "Page annotations object (page {0:d}) is likely malformed. Too big: ({1:d})", num, resolvedObj.arrayGetLength()); ++ goto err2; ++ } ++ if (!resolvedObj.isArray() && !resolvedObj.isNull()) { ++ error(errSyntaxError, -1, "Page annotations object (page {0:d}) is wrong type ({1:s})", num, resolvedObj.getTypeName()); ++ goto err2; ++ } ++ } ++ + // contents + contents = pageObj.dictLookupNF("Contents").copy(); + if (!(contents.isRef() || contents.isArray() || contents.isNull())) { +-- +2.33.0 + diff --git a/poppler.spec b/poppler.spec index a21e10204e66b22bfd9e8f47bf43ccfb6b3574ef..43970694633d4a8be27e82276d5f023e830a0bdd 100644 --- a/poppler.spec +++ b/poppler.spec @@ -4,7 +4,7 @@ Name: poppler Version: 23.12.0 -Release: 8 +Release: 9 Summary: PDF rendering library License: GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ @@ -19,6 +19,7 @@ Patch6001: backport-CVE-2024-56378.patch Patch6002: backport-CVE-2025-32364.patch Patch6003: backport-CVE-2025-32365.patch Patch6004: backport-CVE-2025-43903.patch +Patch6005: backport-CVE-2025-52886.patch BuildRequires: make BuildRequires: cmake @@ -264,6 +265,9 @@ test "$(pkg-config --modversion poppler-qt6)" = "%{version}" %{_mandir}/man1/* %changelog +* Thu Jul 24 2025 lingsheng - 23.12.0-9 +- fix CVE-2025-52886 + * Fri May 16 2025 mahailiang - 23.12.0-8 - enable qt6 on loongarch64 sw_64