Version in base suite: 25.2.3-2+deb13u6 Version in overlay suite: 25.2.3-2+deb13u9 Base version: libreoffice_25.2.3-2+deb13u9 Target version: libreoffice_25.2.3-2+deb13u11 Base file: /srv/ftp-master.debian.org/ftp/pool/main/libr/libreoffice/libreoffice_25.2.3-2+deb13u9.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/libr/libreoffice/libreoffice_25.2.3-2+deb13u11.dsc changelog | 47 + patches/CVE-2026-101351.diff | 37 + patches/CVE-2026-101352-1.diff | 56 + patches/CVE-2026-101352-2.diff | 664 ++++++++++++++++++ patches/CVE-2026-101352-3.diff | 81 ++ patches/CVE-2026-101353-1.diff | 73 + patches/CVE-2026-101353-2.diff | 103 ++ patches/CVE-2026-101353-3.diff | 70 + patches/CVE-2026-101353-4.diff | 78 ++ patches/CVE-2026-101892.diff | 45 + patches/CVE-2026-101929.diff | 41 + patches/CVE-2026-101930.diff | 35 patches/CVE-2026-101933-1.diff | 74 ++ patches/CVE-2026-101933-2.diff | 40 + patches/CVE-2026-104007-1.diff | 53 + patches/CVE-2026-104007-2.diff | 174 ++++ patches/CVE-2026-104007-3.diff | 47 + patches/CVE-2026-104692-1.diff | 74 ++ patches/CVE-2026-104692-2.diff | 46 + patches/CVE-2026-104920.diff | 62 + patches/CVE-2026-104933.diff | 94 ++ patches/CVE-2026-108169.diff | 59 + patches/CVE-2026-18563-1.diff | 82 ++ patches/CVE-2026-18563-10.diff | 49 + patches/CVE-2026-18563-11.diff | 52 + patches/CVE-2026-18563-12.diff | 58 + patches/CVE-2026-18563-13.diff | 597 ++++++++++++++++ patches/CVE-2026-18563-2.diff | 56 + patches/CVE-2026-18563-3.diff | 85 ++ patches/CVE-2026-18563-4.diff | 117 +++ patches/CVE-2026-18563-5.diff | 61 + patches/CVE-2026-18563-6.diff | 99 ++ patches/CVE-2026-18563-7.diff | 96 ++ patches/CVE-2026-18563-8.diff | 45 + patches/CVE-2026-18563-9.diff | 106 ++ patches/CVE-2026-18564.diff | 149 ++++ patches/CVE-2026-18565.diff | 623 ++++++++++++++++ patches/CVE-2026-18566-1.diff | 67 + patches/CVE-2026-18566-10.diff | 90 ++ patches/CVE-2026-18566-11.diff | 315 ++++++++ patches/CVE-2026-18566-2.diff | 32 patches/CVE-2026-18566-3.diff | 48 + patches/CVE-2026-18566-4.diff | 93 ++ patches/CVE-2026-18566-5.diff | 34 patches/CVE-2026-18566-6.diff | 93 ++ patches/CVE-2026-18566-7.diff | 47 + patches/CVE-2026-18566-8.diff | 43 + patches/CVE-2026-18566-9.diff | 109 ++ patches/CVE-2026-63267-1.diff | 21 patches/CVE-2026-84234.diff | 147 +++ patches/CVE-2026-84443-1.diff | 156 ++++ patches/CVE-2026-84443-2.diff | 56 + patches/CVE-2026-84443-3.diff | 37 + patches/CVE-2026-97892.diff | 65 + patches/CVE-2026-97894.diff | 78 ++ patches/CVE-2026-97999.diff | 48 + patches/CVE-2026-98100.diff | 60 + patches/e12c061dbf1330b00cdc73b7691171b6af883764.diff | 52 + patches/series | 55 + 59 files changed, 6064 insertions(+), 10 deletions(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpi8vhc5pp/libreoffice_25.2.3-2+deb13u9.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpi8vhc5pp/libreoffice_25.2.3-2+deb13u11.dsc: no acceptable signature found diff -Nru libreoffice-25.2.3/debian/changelog libreoffice-25.2.3/debian/changelog --- libreoffice-25.2.3/debian/changelog 2026-11-06 19:52:35.000000000 +0000 +++ libreoffice-25.2.3/debian/changelog 2026-11-16 15:10:36.000000000 +0000 @@ -1,3 +1,50 @@ +libreoffice (4:25.2.3-2+deb13u11) trixie-security; urgency=medium + + * fix temporary CVE-87932 backout, sorry + + -- Rene Engelhard Mon, 16 Nov 2026 16:10:36 +0100 + +libreoffice (4:25.2.3-2+deb13u10) trixie-security; urgency=medium + + * debian/patches/*: backport patches for + CVE-2026-18563 ("CFF charstring operand stack out-of-bounds write)" + CVE-2026-18564 ("PDF 2.0 and OOXML Agile encryption key material from a + non-cryptographic random generator") + CVE-2026-18566 ("EMF, EMF+ and WMF import memory safety") + CVE-2026-84234 ("PDF import mask pixel index integer overflow") + CVE-2026-98100 ("HWP picture follow block read past its end") + CVE-2026-101351 ("PICT import leaves part of the pixel buffer + uninitialised") + CVE-2026-101352 ("A document's own toolbars and shortcuts run macros with + no macro security check") + CVE-2026-101353 ("Embedded HSQLDB text table writes to any path") + CVE-2026-104007 ("JDBC class path code execution through a data pilot") + CVE-2026-104692 ("HSQLDB Java method allowlist bypass through generic + JDBC") + CVE-2026-104920 ("file URL with a host passes the Java class path check + (follow-up to CVE-2026-63277)") + CVE-2026-101892 ("Code execution in headless conversion, first step of a + chain through form import") + CVE-2026-84443 ("Base document events bind macro: URLs without the macro + security check") + CVE-2026-97894 ("Stack out-of-bounds read in UTF-16 line reading of Calc + DIF and CSV import") + CVE-2026-97999 ("Firebird SQL_VARYING parameter overflow") + CVE-2026-97892 ("PDF signature /ByteRange heap out-of-bounds write") + CVE-2026-101929 ("Type confusion in SbxVariable::LoadData during ODF + import") + CVE-2026-101930 ("Writer HTML import binds body onload without the macro + security check") + CVE-2026-104933 ("Local text file read through an embedded XGES file in + GStreamer") + CVE-2026-108169 (.iqy web query file on the command line) + CVE-2026-101933 ("Basic image string pool heap out-of-bounds write") + CVE-2026-18565 ("Linked background image fetched without the referer") + * debian/patches/CVE-2026-63267-1.diff: uncomment accidentially left-over, + commented out hunk and make it apply + + -- Rene Engelhard Sun, 15 Nov 2026 13:27:45 +0100 + libreoffice (4:25.2.3-2+deb13u9) trixie-security; urgency=medium * debian/patches/CVE-2026-76181.diff: fix CVE-2026-76181 diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101351.diff libreoffice-25.2.3/debian/patches/CVE-2026-101351.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101351.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101351.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,37 @@ +From 8f4c7cd35ab6671921f6c7fc5e8b905fd3ed4b8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 28 Sep 2026 19:27:52 +0000 +Subject: [PATCH] start with RawBitmap pixels blanked +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +so pixels that a reader never writes, for example when it stops a row +early, are black rather than arbitrary noise + +Signed-off-by: Caolán McNamara +Change-Id: I8e7133427b43447875869d23958dfb4316c4e178 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13725 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13757 +--- + include/vcl/RawBitmap.hxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/vcl/RawBitmap.hxx b/include/vcl/RawBitmap.hxx +index 9b8c5bfbbc3b..7097e89d6e7f 100644 +--- a/include/vcl/RawBitmap.hxx ++++ b/include/vcl/RawBitmap.hxx +@@ -42,7 +42,7 @@ public: + { + throw std::bad_alloc(); + } +- mpData.reset(new sal_uInt8[nDataSize]); ++ mpData.reset(new sal_uInt8[nDataSize]()); + } + void SetPixel(tools::Long nY, tools::Long nX, Color nColor) + { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101352-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-101352-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101352-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101352-1.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,56 @@ +From 8aef0e4eec565e8729ef137255d776fbd0f02604 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 23:17:31 +0000 +Subject: [PATCH] MasterScriptProvider::getScript: match the location to the + context exactly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ib569ce5b5a8ccaf56c7922497b920b79a5b7b846 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13658 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +(cherry picked from commit ae5d7f7ce564b4cd4656366ee88afa762e457c8f) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211527 +Reviewed-by: Xisco Fauli +Tested-by: Jenkins +(cherry picked from commit 9919c425762c21dac30b7bfef9c11a5f9847aa95) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211541 +--- + scripting/source/provider/MasterScriptProvider.cxx | 11 +---------- + 1 file changed, 1 insertion(+), 10 deletions(-) + +diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx +index f033a9dbe317..9d7410046a28 100644 +--- a/scripting/source/provider/MasterScriptProvider.cxx ++++ b/scripting/source/provider/MasterScriptProvider.cxx +@@ -51,15 +51,6 @@ using namespace ::sf_misc; + namespace func_provider + { + +-static bool endsWith( std::u16string_view target, std::u16string_view item ) +-{ +- size_t index = target.find( item ); +- return index != std::u16string_view::npos && +- index == ( target.size() - item.size() ); +-} +- +-/* should be available in some central location. */ +- + // XScriptProvider implementation + + +@@ -286,7 +277,7 @@ MasterScriptProvider::getScript( const OUString& scriptURI ) + if ( ( location == "document" + && m_xModel.is() + ) +- || ( endsWith( m_sCtxString, location ) ) ++ || ( m_sCtxString == location ) + || ( language == "Basic" ) + ) + { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101352-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-101352-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101352-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101352-2.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,664 @@ +From cc565cdfe2b1ec832ef6339b6c045482beca0242 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 18:45:47 +0000 +Subject: [PATCH] handle customized bindings of a document like its other + content +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ic387f8dde45523253c7d833039df4f3d3c47743f +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13655 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +(cherry picked from commit 8c25f8c10100f3f2c93169303752faebced64f90) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/14471 +(cherry picked from commit 70ac0cabc5c94492cf81cd55cfc87f851bbc1e3d) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212369 +Reviewed-by: Xisco Fauli +Tested-by: Jenkins +(cherry picked from commit 9d375606275c5e71391d905e68d2e59a51d9833f) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212408 +(cherry picked from commit 1e39ec81097975c16255ee4d138b732a00ab7660) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212498 +Tested-by: Xisco Fauli +--- + .../core/dataaccess/databasedocument.cxx | 10 +- + .../core/dataaccess/databasedocument.hxx | 2 + + .../documentacceleratorconfiguration.cxx | 46 ++++++ + .../accelerators/acceleratorconfiguration.hxx | 11 ++ + .../uiconfigurationmanager.cxx | 155 +++++++++++++++++- + include/framework/documentmacrocalls.hxx | 39 +++++ + include/sfx2/objsh.hxx | 1 + + include/sfx2/sfxbasemodel.hxx | 4 + + sfx2/source/doc/objmisc.cxx | 35 +++- + sfx2/source/doc/objstor.cxx | 1 + + sfx2/source/doc/objxtor.cxx | 1 + + sfx2/source/doc/sfxbasemodel.cxx | 10 ++ + sfx2/source/inc/objshimp.hxx | 1 + + 13 files changed, 310 insertions(+), 6 deletions(-) + create mode 100644 include/framework/documentmacrocalls.hxx + +diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx +index 0f2586bebc4a..29daa247080e 100644 +--- a/dbaccess/source/core/dataaccess/databasedocument.cxx ++++ b/dbaccess/source/core/dataaccess/databasedocument.cxx +@@ -70,6 +70,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -140,6 +141,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference& + ,m_aViewMonitor( m_aEventNotifier ) + ,m_eInitState( NotInitialized ) + ,m_bClosing( false ) ++ ,m_bMacroCallsAllowed( false ) + ,m_bAllowDocumentScripting( false ) + ,m_bHasBeenRecovered( false ) + ,m_bEmbedded(false) +@@ -466,6 +468,9 @@ void SAL_CALL ODatabaseDocument::initNew( ) + + impl_setInitializing(); + ++ // A new document gets its macros from the user. ++ m_bMacroCallsAllowed = true; ++ + // create a temporary storage + Reference< XStorage > xTempStor( ::comphelper::OStorageHelper::GetTemporaryStorage( m_pImpl->m_aContext ) ); + +@@ -819,7 +824,8 @@ void SAL_CALL ODatabaseDocument::connectController( const Reference< XController + return; + + // check/adjust our macro mode. +- m_pImpl->checkMacrosOnLoading(); ++ m_bMacroCallsAllowed = m_pImpl->checkMacrosOnLoading() || m_bMacroCallsAllowed; ++ framework::setDocumentMacroCallsAllowed( m_xUIConfigurationManager, m_bMacroCallsAllowed ); + } + + void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XController >& _xController ) +@@ -1732,6 +1738,8 @@ Reference< XUIConfigurationManager2 > const & ODatabaseDocument::getUIConfigurat + { + m_xUIConfigurationManager = UIConfigurationManager::create( m_pImpl->m_aContext ); + ++ framework::setDocumentMacroCallsAllowed( m_xUIConfigurationManager, m_bMacroCallsAllowed ); ++ + OUString aUIConfigFolderName( u"Configurations2"_ustr ); + + // First try to open with READWRITE and then READ +diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx +index 46d86d278dc9..5bfbe7fbbd14 100644 +--- a/dbaccess/source/core/dataaccess/databasedocument.hxx ++++ b/dbaccess/source/core/dataaccess/databasedocument.hxx +@@ -195,6 +195,8 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe + */ + InitState m_eInitState; + bool m_bClosing; ++ /// the macro decision allows the document's own UI configuration to call macros ++ bool m_bMacroCallsAllowed; + /// Using atomic because locking around accessing this will lead to deadlock in queryInterface + std::atomic m_bAllowDocumentScripting; + bool m_bHasBeenRecovered; +diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx +index 48155a2f6408..b6a683d1e75b 100644 +--- a/framework/source/accelerators/documentacceleratorconfiguration.cxx ++++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include + +@@ -51,6 +52,9 @@ private: + where we can read/save our configuration data. */ + css::uno::Reference< css::embed::XStorage > m_xDocumentRoot; + ++ /** whether the macros of the document may run */ ++ bool m_bMacroCallsAllowed; ++ + public: + + /** initialize this instance and fill the internal cache. +@@ -64,6 +68,15 @@ public: + + virtual ~DocumentAcceleratorConfiguration() override; + ++ void setMacroCallsAllowed(bool bAllowed) ++ { ++ SolarMutexGuard g; ++ m_bMacroCallsAllowed = bAllowed; ++ } ++ ++ // XAcceleratorConfiguration ++ virtual OUString SAL_CALL getCommandByKeyEvent(const css::awt::KeyEvent& aKeyEvent) override; ++ + virtual OUString SAL_CALL getImplementationName() override + { + return u"com.sun.star.comp.framework.DocumentAcceleratorConfiguration"_ustr; +@@ -92,6 +105,7 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Sequence< css::uno::Any >& lArguments) + : DocumentAcceleratorConfiguration_BASE(xContext) ++ , m_bMacroCallsAllowed(false) + { + SolarMutexGuard g; + css::uno::Reference xRoot; +@@ -132,6 +146,15 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer + fillCache(); + } + ++OUString SAL_CALL DocumentAcceleratorConfiguration::getCommandByKeyEvent(const css::awt::KeyEvent& aKeyEvent) ++{ ++ OUString sCommand = XMLBasedAcceleratorConfiguration::getCommandByKeyEvent(aKeyEvent); ++ SolarMutexGuard g; ++ if (!m_bMacroCallsAllowed && isMacroCallCommand(sCommand)) ++ throw css::container::NoSuchElementException(); ++ return sCommand; ++} ++ + sal_Bool SAL_CALL DocumentAcceleratorConfiguration::hasStorage() + { + SolarMutexGuard g; +@@ -180,6 +203,29 @@ void DocumentAcceleratorConfiguration::fillCache() + + } // namespace framework + ++namespace framework ++{ ++ ++css::uno::Reference< css::ui::XAcceleratorConfiguration > createDocumentAcceleratorConfiguration( ++ const css::uno::Reference< css::uno::XComponentContext >& xContext, ++ const css::uno::Reference< css::embed::XStorage >& xDocumentRoot, bool bMacroCallsAllowed) ++{ ++ rtl::Reference inst = new DocumentAcceleratorConfiguration( ++ xContext, { css::uno::Any(xDocumentRoot) }); ++ inst->setMacroCallsAllowed(bMacroCallsAllowed); ++ inst->fillCache(); ++ return inst; ++} ++ ++void setDocumentAcceleratorMacroCallsAllowed( ++ const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xConfig, bool bAllowed) ++{ ++ if (auto pConfig = dynamic_cast(xConfig.get())) ++ pConfig->setMacroCallsAllowed(bAllowed); ++} ++ ++} ++ + extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * + com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation( + css::uno::XComponentContext *context, +diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx +index 050c8d950475..62ecdd7b8124 100644 +--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx ++++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx +@@ -307,6 +307,17 @@ class XCUBasedAcceleratorConfiguration : public ::cppu::WeakImplHelper< + + }; + ++/** Creates the key binding configuration of a document stored in xDocumentRoot. A binding to a ++ macro call is left out while bMacroCallsAllowed is false. ++ */ ++css::uno::Reference< css::ui::XAcceleratorConfiguration > createDocumentAcceleratorConfiguration( ++ const css::uno::Reference< css::uno::XComponentContext >& xContext, ++ const css::uno::Reference< css::embed::XStorage >& xDocumentRoot, bool bMacroCallsAllowed); ++ ++/** Sets whether the document key binding configuration xConfig keeps its bindings to macro calls. */ ++void setDocumentAcceleratorMacroCallsAllowed( ++ const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xConfig, bool bAllowed); ++ + } // namespace framework + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx +index 48ddeb907e2a..2ba23f0faa97 100644 +--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx ++++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx +@@ -21,6 +21,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -51,6 +53,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -127,6 +130,9 @@ public: + virtual void SAL_CALL setStorage( const css::uno::Reference< css::embed::XStorage >& Storage ) override; + virtual sal_Bool SAL_CALL hasStorage() override; + ++ void setMacroCallsAllowed( bool bAllowed ); ++ bool hasMacroCalls(); ++ + private: + // private data types + enum NotifyOp +@@ -200,6 +206,8 @@ private: + comphelper::OInterfaceContainerHelper4 m_aConfigListeners; + rtl::Reference< ImageManager > m_xImageManager; + css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAccConfig; ++ /// whether the macros of the document may run ++ bool m_bMacroCallsAllowed; + }; + + // important: The order and position of the elements must match the constant +@@ -218,6 +226,65 @@ constexpr std::u16string_view UIELEMENTTYPENAMES[] = + + constexpr std::u16string_view RESOURCEURL_PREFIX = u"private:resource/"; + ++bool lcl_hasMacroCalls( const Reference< XIndexAccess >& xItems ) ++{ ++ if ( !xItems.is() ) ++ return false; ++ for ( sal_Int32 i = 0, nCount = xItems->getCount(); i < nCount; ++i ) ++ { ++ Sequence< PropertyValue > aProps; ++ if ( !( xItems->getByIndex( i ) >>= aProps ) ) ++ continue; ++ for ( const PropertyValue& rProp : aProps ) ++ { ++ OUString sCommand; ++ Reference< XIndexAccess > xSubItems; ++ if ( rProp.Name == "CommandURL" && ( rProp.Value >>= sCommand ) ++ && isMacroCallCommand( sCommand ) ) ++ return true; ++ if ( rProp.Name == "ItemDescriptorContainer" && ( rProp.Value >>= xSubItems ) ++ && lcl_hasMacroCalls( xSubItems ) ) ++ return true; ++ } ++ } ++ return false; ++} ++ ++Reference< XIndexAccess > lcl_withoutMacroCalls( const Reference< XIndexAccess >& xItems ) ++{ ++ if ( !lcl_hasMacroCalls( xItems ) ) ++ return xItems; ++ ++ rtl::Reference< RootItemContainer > xCopy = new RootItemContainer( xItems ); ++ for ( sal_Int32 i = xCopy->getCount() - 1; i >= 0; --i ) ++ { ++ Sequence< PropertyValue > aProps; ++ if ( !( xCopy->getByIndex( i ) >>= aProps ) ) ++ continue; ++ bool bRemove = false; ++ bool bReplace = false; ++ for ( PropertyValue& rProp : asNonConstRange( aProps ) ) ++ { ++ OUString sCommand; ++ Reference< XIndexAccess > xSubItems; ++ if ( rProp.Name == "CommandURL" && ( rProp.Value >>= sCommand ) ++ && isMacroCallCommand( sCommand ) ) ++ bRemove = true; ++ else if ( rProp.Name == "ItemDescriptorContainer" && ( rProp.Value >>= xSubItems ) ++ && lcl_hasMacroCalls( xSubItems ) ) ++ { ++ rProp.Value <<= lcl_withoutMacroCalls( xSubItems ); ++ bReplace = true; ++ } ++ } ++ if ( bRemove ) ++ xCopy->removeByIndex( i ); ++ else if ( bReplace ) ++ xCopy->replaceByIndex( i, Any( aProps ) ); ++ } ++ return new ConstItemContainer( xCopy ); ++} ++ + sal_Int16 RetrieveTypeFromResourceURL( std::u16string_view aResourceURL ) + { + +@@ -678,6 +745,7 @@ UIConfigurationManager::UIConfigurationManager( css::uno::Reference< css::uno::X + , m_bDisposed( false ) + , m_aPropUIName( u"UIName"_ustr ) + , m_xContext(std::move( xContext )) ++ , m_bMacroCallsAllowed( false ) + { + // Make sure we have a default initialized entry for every layer and user interface element type! + // The following code depends on this! +@@ -923,8 +991,10 @@ Reference< XIndexAccess > SAL_CALL UIConfigurationManager::getSettings( const OU + // Create a copy of our data if someone wants to change the data. + if ( bWriteable ) + return Reference< XIndexAccess >( new RootItemContainer( pDataSettings->xSettings ) ); +- else ++ else if ( m_bMacroCallsAllowed ) + return pDataSettings->xSettings; ++ else ++ return lcl_withoutMacroCalls( pDataSettings->xSettings ); + } + + throw NoSuchElementException(); +@@ -1139,7 +1209,7 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager() + + Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::createShortCutManager() + { +- return DocumentAcceleratorConfiguration::createWithDocumentRoot(m_xContext, m_xDocConfigStorage); ++ return createDocumentAcceleratorConfiguration(m_xContext, m_xDocConfigStorage, m_bMacroCallsAllowed); + } + + Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShortCutManager() +@@ -1149,8 +1219,8 @@ Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShort + + if (!m_xAccConfig.is()) try + { +- m_xAccConfig = DocumentAcceleratorConfiguration:: +- createWithDocumentRoot(m_xContext, m_xDocConfigStorage); ++ m_xAccConfig = createDocumentAcceleratorConfiguration(m_xContext, m_xDocConfigStorage, ++ m_bMacroCallsAllowed); + } + catch ( const css::uno::DeploymentException& ) + { +@@ -1161,6 +1231,50 @@ Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShort + return m_xAccConfig; + } + ++void UIConfigurationManager::setMacroCallsAllowed( bool bAllowed ) ++{ ++ SolarMutexGuard g; ++ m_bMacroCallsAllowed = bAllowed; ++ setDocumentAcceleratorMacroCallsAllowed( m_xAccConfig, bAllowed ); ++} ++ ++bool UIConfigurationManager::hasMacroCalls() ++{ ++ SolarMutexGuard g; ++ ++ if ( m_bDisposed ) ++ throw DisposedException(); ++ ++ for ( sal_Int16 i = 1; i < css::ui::UIElementType::COUNT; i++ ) ++ { ++ impl_preloadUIElementTypeList( i ); ++ for ( auto const& rElement : m_aUIElements[i].aElementsHashMap ) ++ { ++ UIElementData* pData = impl_findUIElementData( rElement.first, i ); ++ if ( pData && !pData->bDefault && lcl_hasMacroCalls( pData->xSettings ) ) ++ return true; ++ } ++ } ++ ++ Reference< XAcceleratorConfiguration > xAccConfig = getShortCutManager(); ++ if ( !xAccConfig.is() ) ++ return false; ++ for ( const css::awt::KeyEvent& rKey : xAccConfig->getAllKeyEvents() ) ++ { ++ try ++ { ++ if ( isMacroCallCommand( xAccConfig->getCommandByKeyEvent( rKey ) ) ) ++ return true; ++ } ++ catch ( const NoSuchElementException& ) ++ { ++ // A listed key without a command has a macro call that is not allowed. ++ return true; ++ } ++ } ++ return false; ++} ++ + Reference< XInterface > SAL_CALL UIConfigurationManager::getEventsManager() + { + return Reference< XInterface >(); +@@ -1392,6 +1506,39 @@ void UIConfigurationManager::implts_notifyContainerListener( const Configuration + + } + ++namespace framework ++{ ++bool isMacroCallCommand( std::u16string_view rCommand ) ++{ ++ if ( rCommand.empty() ) ++ return false; ++ OUString sCommand = rtl::Uri::decode( OUString( rCommand ), rtl_UriDecodeWithCharset, ++ RTL_TEXTENCODING_UTF8 ).toAsciiLowerCase(); ++ if ( !sCommand.startsWith( ".uno:" ) && !sCommand.startsWith( "slot:" ) ) ++ return !sCommand.startsWith( "vnd.sun.star.findbar:" ); ++ sal_Int32 nArguments = sCommand.indexOf( '?' ); ++ if ( nArguments < 0 ) ++ return false; ++ std::u16string_view aArguments = std::u16string_view( sCommand ).substr( nArguments + 1 ); ++ return aArguments.find( u"macro:" ) != std::u16string_view::npos ++ || aArguments.find( u"vnd.sun.star.script:" ) != std::u16string_view::npos ++ || aArguments.find( u"referer" ) != std::u16string_view::npos; ++} ++ ++void setDocumentMacroCallsAllowed( const Reference< XUIConfigurationManager2 >& rxManager, ++ bool bAllowed ) ++{ ++ if ( auto pManager = dynamic_cast< UIConfigurationManager* >( rxManager.get() ) ) ++ pManager->setMacroCallsAllowed( bAllowed ); ++} ++ ++bool documentConfigurationHasMacroCalls( const Reference< XUIConfigurationManager2 >& rxManager ) ++{ ++ auto pManager = dynamic_cast< UIConfigurationManager* >( rxManager.get() ); ++ return pManager && pManager->hasMacroCalls(); ++} ++} ++ + extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * + com_sun_star_comp_framework_UIConfigurationManager_get_implementation( + css::uno::XComponentContext *context, +diff --git a/include/framework/documentmacrocalls.hxx b/include/framework/documentmacrocalls.hxx +new file mode 100644 +index 000000000000..eb92fb5cd675 +--- /dev/null ++++ b/include/framework/documentmacrocalls.hxx +@@ -0,0 +1,39 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ ++/* ++ * This file is part of the LibreOffice project. ++ * ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ */ ++ ++#pragma once ++ ++#include ++#include ++ ++#include ++ ++namespace framework ++{ ++/** Whether a command URL runs a macro or a script, or names one in its arguments. A .uno:, slot: ++ or findbar command is not a macro call, unless its arguments name a macro: or ++ vnd.sun.star.script: URL or a Referer. ++ */ ++FWK_DLLPUBLIC bool isMacroCallCommand(std::u16string_view rCommand); ++ ++/** Sets whether the macros of the document that owns rxManager may run. The macro call commands ++ of the document's own UI configuration are left out of its settings and key bindings until ++ this is set to true. ++ */ ++FWK_DLLPUBLIC void setDocumentMacroCallsAllowed( ++ const css::uno::Reference& rxManager, bool bAllowed); ++ ++/** Whether the document's own UI configuration held by rxManager has a macro call command in any ++ of its elements or key bindings. ++ */ ++FWK_DLLPUBLIC bool documentConfigurationHasMacroCalls( ++ const css::uno::Reference& rxManager); ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ +diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx +index 5defe29b2027..867b287ff56b 100644 +--- a/include/sfx2/objsh.hxx ++++ b/include/sfx2/objsh.hxx +@@ -760,6 +760,7 @@ public: + SAL_DLLPRIVATE void InitOwnModel_Impl(); + SAL_DLLPRIVATE void BreakMacroSign_Impl( bool bBreakMacroSing ); + SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl(); ++ SAL_DLLPRIVATE bool DocumentUIConfigurationHasMacroCalls_Impl(); + SAL_DLLPRIVATE void CheckForBrokenDocSignatures_Impl(); + SAL_DLLPRIVATE void CheckEncryption_Impl( const css::uno::Reference< css::task::XInteractionHandler >& xHandler ); + SAL_DLLPRIVATE void SetModifyPasswordEntered( bool bEntered = true ); +diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx +index 874367b9a4a2..2b0ddce82fe6 100644 +--- a/include/sfx2/sfxbasemodel.hxx ++++ b/include/sfx2/sfxbasemodel.hxx +@@ -678,6 +678,10 @@ public: + SfxObjectShell* GetObjectShell() const ; + + SAL_DLLPRIVATE bool impl_isDisposed() const ; ++ /** Passes the macro decision to the UI configuration manager of the document, if it exists ++ yet. A manager created later takes the decision from the object shell. ++ */ ++ SAL_DLLPRIVATE void SetUIConfigurationMacroCallsAllowed_Impl( bool bAllowed ); + bool IsInitialized() const; + void MethodEntryCheck( const bool i_mustBeInitialized ) const; + +diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx +index 0ca4955b1c78..01d6478ed901 100644 +--- a/sfx2/source/doc/objmisc.cxx ++++ b/sfx2/source/doc/objmisc.cxx +@@ -78,6 +78,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -979,6 +981,31 @@ void SfxObjectShell::BreakMacroSign_Impl( bool bBreakMacroSign ) + } + + ++bool SfxObjectShell::DocumentUIConfigurationHasMacroCalls_Impl() ++{ ++ try ++ { ++ uno::Reference xStorage = GetStorage(); ++ if (!xStorage.is() || !xStorage->hasByName(u"Configurations2"_ustr)) ++ return false; ++ uno::Reference xConfigStorage ++ = xStorage->openStorageElement(u"Configurations2"_ustr, embed::ElementModes::READ); ++ // A separate manager reads the folder, so the model's own manager is still created when ++ // the view first asks for it. ++ uno::Reference xConfiguration ++ = ui::UIConfigurationManager::create(comphelper::getProcessComponentContext()); ++ xConfiguration->setStorage(xConfigStorage); ++ const bool bHasMacroCalls = framework::documentConfigurationHasMacroCalls(xConfiguration); ++ xConfiguration->dispose(); ++ return bHasMacroCalls; ++ } ++ catch (const uno::Exception&) ++ { ++ TOOLS_WARN_EXCEPTION("sfx.doc", ""); ++ } ++ return false; ++} ++ + void SfxObjectShell::CheckSecurityOnLoading_Impl() + { + if (GetErrorCode() == ERRCODE_IO_BROKENPACKAGE) +@@ -1000,10 +1027,16 @@ void SfxObjectShell::CheckSecurityOnLoading_Impl() + CheckEncryption_Impl( xInteraction ); + + // check macro security ++ if (!GetMacroCallsSeenWhileLoading() && DocumentUIConfigurationHasMacroCalls_Impl()) ++ SetMacroCallsSeenWhileLoading(); + const bool bHasValidContentSignature = HasValidSignatures(); + const bool bHasMacros = pImpl->aMacroMode.hasMacros(); +- pImpl->aMacroMode.checkMacrosOnLoading( xInteraction, bHasValidContentSignature, bHasMacros ); ++ const bool bMacrosAllowed = pImpl->aMacroMode.checkMacrosOnLoading( ++ xInteraction, bHasValidContentSignature, bHasMacros); + pImpl->m_bHadCheckedMacrosOnLoad = bHasMacros; ++ pImpl->m_bMacroCallsAllowed = bMacrosAllowed; ++ if (pImpl->pBaseModel.is()) ++ pImpl->pBaseModel->SetUIConfigurationMacroCallsAllowed_Impl(bMacrosAllowed); + } + + bool SfxObjectShell::GetHadCheckedMacrosOnLoad() const +diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx +index 6cef54a2fb3d..7107abdc2183 100644 +--- a/sfx2/source/doc/objstor.cxx ++++ b/sfx2/source/doc/objstor.cxx +@@ -504,6 +504,7 @@ bool SfxObjectShell::DoInitNew() + { + // empty documents always get their macros from the user, so there is no reason to restrict access + pImpl->aMacroMode.allowMacroExecution(); ++ pImpl->m_bMacroCallsAllowed = true; + if ( SfxObjectCreateMode::EMBEDDED == eCreateMode ) + SetTitle(SfxResId(STR_NONAME)); + +diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx +index f84d965bab54..cbc612284a44 100644 +--- a/sfx2/source/doc/objxtor.cxx ++++ b/sfx2/source/doc/objxtor.cxx +@@ -209,6 +209,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) + ,bPreserveVersions( true ) + ,m_bMacroSignBroken( false ) + ,m_bNoBasicCapabilities( false ) ++ ,m_bMacroCallsAllowed( false ) + ,m_bDocRecoverySupport( true ) + ,bQueryLoadTemplate( true ) + ,bLoadReadonly( false ) +diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx +index c7be974c102c..ec19181b7c0b 100644 +--- a/sfx2/source/doc/sfxbasemodel.cxx ++++ b/sfx2/source/doc/sfxbasemodel.cxx +@@ -100,6 +100,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -3709,6 +3710,12 @@ Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfigurati + return Reference< ui::XUIConfigurationManager >( getUIConfigurationManager2(), UNO_QUERY_THROW ); + } + ++void SfxBaseModel::SetUIConfigurationMacroCallsAllowed_Impl( bool bAllowed ) ++{ ++ if ( m_pData ) ++ framework::setDocumentMacroCallsAllowed( m_pData->m_xUIConfigurationManager, bAllowed ); ++} ++ + Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManager2() + { + SfxModelGuard aGuard( *this ); +@@ -3718,6 +3725,9 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage + Reference< ui::XUIConfigurationManager2 > xNewUIConfMan = + ui::UIConfigurationManager::create( comphelper::getProcessComponentContext() ); + ++ framework::setDocumentMacroCallsAllowed( ++ xNewUIConfMan, m_pData->m_pObjectShell->Get_Impl()->m_bMacroCallsAllowed ); ++ + Reference< embed::XStorage > xConfigStorage; + + OUString aUIConfigFolderName( u"Configurations2"_ustr ); +diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx +index 1e0680cd6da1..4e1e1104bdfa 100644 +--- a/sfx2/source/inc/objshimp.hxx ++++ b/sfx2/source/inc/objshimp.hxx +@@ -77,6 +77,7 @@ struct SfxObjectShell_Impl final : public ::sfx2::IMacroDocumentAccess + bPreserveVersions:1, + m_bMacroSignBroken:1, // whether the macro signature was explicitly broken + m_bNoBasicCapabilities:1, ++ m_bMacroCallsAllowed:1, // the macro decision allows the document's own UI configuration to call macros + m_bDocRecoverySupport:1, + bQueryLoadTemplate:1, + bLoadReadonly:1, +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101352-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-101352-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101352-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101352-3.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,81 @@ +From cee8b96bd7eea5153b4ed9d6c821ee8f3c77882d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 22:36:39 +0000 +Subject: [PATCH] reuse INetURLObject::IsExoticProtocol for other binding + command schemes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Icc3b4d11f725350187e4a17c6fd246c24114ea96 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13656 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/15195 +Reviewed-by: Miklos Vajna +(cherry picked from commit 770fcb69cb232b9c9cbb17304aca9fc963621dc1) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212468 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit ce19ab84625995f197887cf3559b1d1ce2a2f087) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212520 +Reviewed-by: Adolfo Jayme Barrientos +(cherry picked from commit e0ac8ad7e95e6cb1b1d3248950b352a59ca7a839) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212578 +(cherry picked from commit 46a149c2d0ed40dee5bafa7b0c36f0c7d4ec04ea) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212808 +Tested-by: Xisco Fauli +--- + .../source/uiconfiguration/uiconfigurationmanager.cxx | 9 ++++++++- + include/framework/documentmacrocalls.hxx | 7 ++++--- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx +index 2ba23f0faa97..2afde9197f7d 100644 +--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx ++++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx +@@ -54,6 +54,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1515,7 +1516,13 @@ bool isMacroCallCommand( std::u16string_view rCommand ) + OUString sCommand = rtl::Uri::decode( OUString( rCommand ), rtl_UriDecodeWithCharset, + RTL_TEXTENCODING_UTF8 ).toAsciiLowerCase(); + if ( !sCommand.startsWith( ".uno:" ) && !sCommand.startsWith( "slot:" ) ) +- return !sCommand.startsWith( "vnd.sun.star.findbar:" ); ++ { ++ // The shipped key bindings use the findbar command. ++ if ( sCommand.startsWith( "vnd.sun.star.findbar:" ) ) ++ return false; ++ INetURLObject aURL( rCommand ); ++ return aURL.GetProtocol() == INetProtocol::NotValid || aURL.IsExoticProtocol(); ++ } + sal_Int32 nArguments = sCommand.indexOf( '?' ); + if ( nArguments < 0 ) + return false; +diff --git a/include/framework/documentmacrocalls.hxx b/include/framework/documentmacrocalls.hxx +index eb92fb5cd675..8dce1b5a13bc 100644 +--- a/include/framework/documentmacrocalls.hxx ++++ b/include/framework/documentmacrocalls.hxx +@@ -16,9 +16,10 @@ + + namespace framework + { +-/** Whether a command URL runs a macro or a script, or names one in its arguments. A .uno:, slot: +- or findbar command is not a macro call, unless its arguments name a macro: or +- vnd.sun.star.script: URL or a Referer. ++/** Whether a command URL runs a macro or a script, or names one in its arguments. A .uno: or slot: ++ command is a macro call when its arguments name a macro: or vnd.sun.star.script: URL or a ++ Referer. The findbar command is not one. Any other command is one when its URL does not parse ++ or its scheme is one INetURLObject::IsExoticProtocol does not accept. + */ + FWK_DLLPUBLIC bool isMacroCallCommand(std::u16string_view rCommand); + +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101353-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-101353-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101353-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101353-1.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,73 @@ +From 1d872726606d7cac22934b80e508cbfd8866b870 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 28 Sep 2026 22:51:11 +0000 +Subject: [PATCH] hsqldb: check an existing lock file rather than taking it + over +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +backport of upstream HSQLDB svn r3155, from the 1.8.1 release + +Change-Id: Ide9ff01e0ea589a6676835baf32a8ae09c5234fd +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13737 +Tested-by: Jenkins CPCI +Reviewed-by: Miklos Vajna +--- + external/hsqldb/UnpackedTarball_hsqldb.mk | 1 + + external/hsqldb/patches/lockfile.patch.1 | 30 +++++++++++++++++++++++ + 2 files changed, 31 insertions(+) + create mode 100644 external/hsqldb/patches/lockfile.patch.1 + +diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk +index 1ee4beb5e430..29f187214dc4 100644 +--- a/external/hsqldb/UnpackedTarball_hsqldb.mk ++++ b/external/hsqldb/UnpackedTarball_hsqldb.mk +@@ -31,6 +31,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ + external/hsqldb/patches/multipleResultSets.patch \ + external/hsqldb/patches/disable-dump-script.patch \ + external/hsqldb/patches/use-system-servlet-api.jar.diff \ ++ external/hsqldb/patches/lockfile.patch.1 \ + )) + + # vim: set noet sw=4 ts=4: +diff --git a/external/hsqldb/patches/lockfile.patch.1 b/external/hsqldb/patches/lockfile.patch.1 +new file mode 100644 +index 000000000000..a079ac9cf9f5 +--- /dev/null ++++ b/external/hsqldb/patches/lockfile.patch.1 +@@ -0,0 +1,30 @@ ++From 648ff3be795c39d9d5f8bccb55253fd674ffe91d Mon Sep 17 00:00:00 2001 ++From: fredt ++Date: Mon, 31 Aug 2009 17:27:31 +0000 ++Subject: [PATCH] code updates leading to 1.8.1 release ++ ++git-svn-id: https://svn.code.sf.net/p/hsqldb/svn/base-one/trunk@3155 7c7dc5f5-a22d-0410-a3af-b41755a11667 ++--- ++ src/org/hsqldb/persist/LockFile.java | 6 +++--- ++ 1 file changed, 3 insertions(+), 3 deletions(-) ++ ++diff --git a/src/org/hsqldb/persist/LockFile.java b/src/org/hsqldb/persist/LockFile.java ++index ece83bb..6045bed 100755 ++--- a/src/org/hsqldb/persist/LockFile.java +++++ b/src/org/hsqldb/persist/LockFile.java ++@@ -795,9 +795,9 @@ public class LockFile { ++ try { ++ if (withCreateNewFile) { ++ try { ++- file.createNewFile(); ++- ++- return; +++ if (file.createNewFile()) { +++ return; +++ } ++ } catch (IOException ioe) {} ++ } ++ ++-- ++2.55.0 ++ +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101353-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-101353-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101353-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101353-2.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,103 @@ +From 8008e62f8dd6f2b34c35055d070a0b1ecea8826f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 29 Sep 2026 14:42:34 +0000 +Subject: [PATCH] hsqldb: keep the files of an embedded database in a private + directory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +hsqldb writes its own files next to the database path, and that path was +the document's location. Put each embedded database in a subdirectory +of a directory the driver owns and removes. + +Change-Id: I17d2a7e365c51c743d8c359f7b1794b810a8bcc5 +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13818 +Reviewed-by: Miklos Vajna +Tested-by: Jenkins CPCI +--- + .../source/drivers/hsqldb/HDriver.cxx | 31 +++++++++++++++++-- + connectivity/source/inc/hsqldb/HDriver.hxx | 4 +++ + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx +index 9827553408fc..188eeec16337 100644 +--- a/connectivity/source/drivers/hsqldb/HDriver.cxx ++++ b/connectivity/source/drivers/hsqldb/HDriver.cxx +@@ -78,7 +78,9 @@ namespace connectivity + : ODriverDelegator_BASE(m_aMutex) + ,m_xContext(_rxContext) + ,m_bInShutDownConnections(false) ++ ,m_aDatabaseDirectory(nullptr, true) + { ++ m_aDatabaseDirectory.EnableKillingFile(true); + } + + +@@ -200,8 +202,33 @@ namespace connectivity + + ::comphelper::NamedValueCollection aProperties; + ++ // The database path keeps the document's file name as its last part, because the ++ // streams in older documents are named after it. ++ OUString sKey = StorageContainer::getRegisteredKey(xStorage); ++ OUString sDatabasePath; ++ if (!sKey.isEmpty()) ++ sDatabasePath = StorageContainer::getRegisteredStorage(sKey).url; ++ else ++ { ++ OUString sDirectoryPath; ++ if (m_aDatabaseDirectory.IsValid()) ++ { ++ const OUString sDirectoryURL ++ = ::utl::CreateTempURL(&m_aDatabaseDirectory.GetURL(), true); ++ osl_getSystemPathFromFileURL(sDirectoryURL.pData, &sDirectoryPath.pData); ++ } ++ if (sDirectoryPath.isEmpty()) ++ { ++ ::connectivity::SharedResources aResources; ++ const OUString sMessage = aResources.getResourceString(STR_NO_STORAGE); ++ ::dbtools::throwGenericSQLException(sMessage ,*this); ++ } ++ sDatabasePath = sDirectoryPath + OUStringChar(SAL_PATHDELIMITER) ++ + StorageContainer::removeOldURLPrefix(sSystemPath); ++ sKey = StorageContainer::registerStorage(xStorage, sDatabasePath); ++ } ++ + // properties for accessing the embedded storage +- OUString sKey = StorageContainer::registerStorage( xStorage, sSystemPath ); + aProperties.put( u"storage_key"_ustr, sKey ); + aProperties.put( u"storage_class_name"_ustr, + u"com.sun.star.sdbcx.comp.hsqldb.StorageAccess"_ustr ); +@@ -340,7 +367,7 @@ namespace connectivity + + Sequence< PropertyValue > aConnectionArgs; + aProperties >>= aConnectionArgs; +- OUString sConnectURL = "jdbc:hsqldb:" + sSystemPath; ++ OUString sConnectURL = "jdbc:hsqldb:" + sDatabasePath; + Reference xOrig; + try + { +diff --git a/connectivity/source/inc/hsqldb/HDriver.hxx b/connectivity/source/inc/hsqldb/HDriver.hxx +index 7b4735517fd5..bfa3f2a0274b 100644 +--- a/connectivity/source/inc/hsqldb/HDriver.hxx ++++ b/connectivity/source/inc/hsqldb/HDriver.hxx +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + + namespace connectivity::hsqldb +@@ -57,6 +58,9 @@ namespace connectivity::hsqldb + css::uno::Reference< css::sdbc::XDriver > m_xDriver; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + bool m_bInShutDownConnections; ++ // Private directory, removed with its contents when the driver goes away. It holds one ++ // subdirectory per registered storage, and that storage's database path lies inside it. ++ ::utl::TempFileNamed m_aDatabaseDirectory; + + /** load the driver we want to delegate. + The m_xDriver may be if the driver could not be loaded. diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101353-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-101353-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101353-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101353-3.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,70 @@ +From 866cad0af60543757ea2ef5a2c484dc79f20d3d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 29 Sep 2026 16:53:56 +0000 +Subject: [PATCH] hsqldb: read textdb.allow_full_path only as a Java system + property +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +as hsqldb 2.x does since 2.1.0 + +Change-Id: I17101ccd6e8af3adee46644b197d94498b4f32fb +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13829 +Tested-by: Jenkins CPCI +Reviewed-by: Miklos Vajna +--- + external/hsqldb/UnpackedTarball_hsqldb.mk | 1 + + .../allow-full-path-system-property.patch.1 | 27 +++++++++++++++++++ + 2 files changed, 28 insertions(+) + create mode 100644 external/hsqldb/patches/allow-full-path-system-property.patch.1 + +diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk +index 29f187214dc4..22f1b6332489 100644 +--- a/external/hsqldb/UnpackedTarball_hsqldb.mk ++++ b/external/hsqldb/UnpackedTarball_hsqldb.mk +@@ -32,6 +32,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ + external/hsqldb/patches/disable-dump-script.patch \ + external/hsqldb/patches/use-system-servlet-api.jar.diff \ + external/hsqldb/patches/lockfile.patch.1 \ ++ external/hsqldb/patches/allow-full-path-system-property.patch.1 \ + )) + + # vim: set noet sw=4 ts=4: +diff --git a/external/hsqldb/patches/allow-full-path-system-property.patch.1 b/external/hsqldb/patches/allow-full-path-system-property.patch.1 +new file mode 100644 +index 000000000000..631999bcf615 +--- /dev/null ++++ b/external/hsqldb/patches/allow-full-path-system-property.patch.1 +@@ -0,0 +1,27 @@ ++From 80a589cc94dd3c67d7cbf978ca4c4328b84eb856 Mon Sep 17 00:00:00 2001 ++From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= ++Date: Tue, 29 Sep 2026 15:41:04 +0000 ++Subject: [PATCH] read textdb.allow_full_path only as a Java system property ++ ++HSQLDB 2.x reads it that way since 2.1.0, see svn r3769 ++https://github.com/ryenus/hsqldb/commit/909e46eb5aea11a38aad3d1f57f5a656eba8132e ++--- ++ src/org/hsqldb/persist/Log.java | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/src/org/hsqldb/persist/Log.java b/src/org/hsqldb/persist/Log.java ++index 284d9f4..18c698b 100644 ++--- a/src/org/hsqldb/persist/Log.java +++++ b/src/org/hsqldb/persist/Log.java ++@@ -763,7 +763,7 @@ public class Log { ++ ++ closeTextCache(table); ++ ++- if (!properties.isPropertyTrue( +++ if (!Boolean.getBoolean( ++ HsqlDatabaseProperties.textdb_allow_full_path)) { ++ if (source.indexOf("..") != -1) { ++ throw (Trace.error(Trace.ACCESS_IS_DENIED, source)); ++-- ++2.55.0 ++ +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101353-4.diff libreoffice-25.2.3/debian/patches/CVE-2026-101353-4.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101353-4.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101353-4.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,78 @@ +From e8fb60ff0a5b148235045564113dcdb92162a8f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 29 Sep 2026 19:07:09 +0000 +Subject: [PATCH] hsqldb: no text table files for an embedded database +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +hsqldb already refuses text tables for a database that is not file +based, so do the same for a database kept inside the document. + +An existing text table in such a database then opens disconnected. + +Change-Id: I0a07fd7ba59814ef0eb0bec3ee317967a937362c +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13831 +Reviewed-by: Miklos Vajna +Tested-by: Jenkins CPCI +--- + external/hsqldb/UnpackedTarball_hsqldb.mk | 1 + + .../hsqldb/patches/stored-text-table.patch.1 | 33 +++++++++++++++++++ + 2 files changed, 34 insertions(+) + create mode 100644 external/hsqldb/patches/stored-text-table.patch.1 + +diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk +index 22f1b6332489..8f311bac3d0c 100644 +--- a/external/hsqldb/UnpackedTarball_hsqldb.mk ++++ b/external/hsqldb/UnpackedTarball_hsqldb.mk +@@ -33,6 +33,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ + external/hsqldb/patches/use-system-servlet-api.jar.diff \ + external/hsqldb/patches/lockfile.patch.1 \ + external/hsqldb/patches/allow-full-path-system-property.patch.1 \ ++ external/hsqldb/patches/stored-text-table.patch.1 \ + )) + + # vim: set noet sw=4 ts=4: +diff --git a/external/hsqldb/patches/stored-text-table.patch.1 b/external/hsqldb/patches/stored-text-table.patch.1 +new file mode 100644 +index 000000000000..861b17f81526 +--- /dev/null ++++ b/external/hsqldb/patches/stored-text-table.patch.1 +@@ -0,0 +1,33 @@ ++From 41cf60044df19e42307d025311592f9a1dcb211a Mon Sep 17 00:00:00 2001 ++From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= ++Date: Tue, 29 Sep 2026 18:51:36 +0000 ++Subject: [PATCH] no text table files for a database with a custom file access ++ ++hsqldb already refuses text tables for a database that is not file based, ++see Table.java DATABASE_IS_MEMORY_ONLY, and hsqldb 2.x refuses text table ++files for a memory database in Logger.getSecurePath since svn r5081 ++https://github.com/ryenus/hsqldb/commit/3846b278dfa47e28017bb1c696f0eb1667976f73 ++--- ++ src/org/hsqldb/persist/Log.java | 6 ++++++ ++ 1 file changed, 6 insertions(+) ++ ++diff --git a/src/org/hsqldb/persist/Log.java b/src/org/hsqldb/persist/Log.java ++index 18c698b..52e5182 100644 ++--- a/src/org/hsqldb/persist/Log.java +++++ b/src/org/hsqldb/persist/Log.java ++@@ -763,6 +763,12 @@ public class Log { ++ ++ closeTextCache(table); ++ +++ // A database with a custom file access keeps all its files where that +++ // access puts them, and a text table source is a file outside it. +++ if (database.isStoredFileAccess()) { +++ throw (Trace.error(Trace.ACCESS_IS_DENIED, source)); +++ } +++ ++ if (!Boolean.getBoolean( ++ HsqlDatabaseProperties.textdb_allow_full_path)) { ++ if (source.indexOf("..") != -1) { ++-- ++2.55.0 ++ +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101892.diff libreoffice-25.2.3/debian/patches/CVE-2026-101892.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101892.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101892.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,45 @@ +From ed137476afd19a0324bf117fd315b751bfa920c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 28 Sep 2026 14:02:08 +0000 +Subject: [PATCH] only use the form import object when it is a form component +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I38968a0834a044ceb068337fe1d96eb364739019 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13698 +Reviewed-by: Noel Grandin +--- + engine/xmloff/source/forms/elementimport.cxx | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a//xmloff/source/forms/elementimport.cxx b//xmloff/source/forms/elementimport.cxx +index 5e20df4d4d4c..90ac55f9c000 100644 +--- a//xmloff/source/forms/elementimport.cxx ++++ b//xmloff/source/forms/elementimport.cxx +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -588,6 +589,13 @@ namespace xmloff + OStringBuffer("OElementImport::createElement: service factory gave me no object (service name: " + + OUStringToOString(m_sServiceName, RTL_TEXTENCODING_ASCII_US) + + ")!").getStr()); ++ // only use the created object when it is a form component ++ if (!Reference< XFormComponent >(xPure, UNO_QUERY).is()) ++ { ++ SAL_WARN("xmloff.forms", "OElementImport::createElement: " << m_sServiceName ++ << " is not a form component"); ++ return xReturn; ++ } + xReturn.set(xPure, UNO_QUERY); + if (auto const props = Reference(xPure, css::uno::UNO_QUERY)) + { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101929.diff libreoffice-25.2.3/debian/patches/CVE-2026-101929.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101929.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101929.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,41 @@ +From 339f016dc6b1f9aeb8ae1160adf4e6854676c4d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 26 Sep 2026 14:01:28 +0000 +Subject: [PATCH] clear the old value before loading an old format SbxVariable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +as the newer format already does + +The old format path set the new type without clearing an existing value +first, so the new type bogusly redefined whatever the union still held. + +Signed-off-by: Caolán McNamara +Change-Id: I70d02026d24443ab353be37c0a57685b4e7ac969 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13600 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13732 +Reviewed-by: Miklos Vajna +(cherry picked from commit 35a9e5d20be854e8392795d06c168eca6d270a21) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13967 +--- + basic/source/sbx/sbxvar.cxx | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx +index 43cb0b73a03d..2366d23813b3 100644 +--- a/basic/source/sbx/sbxvar.cxx ++++ b/basic/source/sbx/sbxvar.cxx +@@ -441,6 +441,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) + SbxValues aTmp; + OUString aTmpString; + OUString aVal; ++ SbxValue::Clear(); + aTmp.eType = aData.eType = static_cast(nType); + aTmp.pOUString = &aVal; + switch( nType ) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101930.diff libreoffice-25.2.3/debian/patches/CVE-2026-101930.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101930.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101930.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,35 @@ +From d5ed5aeaa64aa89329b6350ad254d88c101a8fdc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 23:24:50 +0000 +Subject: [PATCH] note a document event from HTML import like the other HTML + events +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I73da657a72b0ac7cb6f58d2cd766a3ab292bf8b1 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13667 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/14076 +--- + sw/source/filter/html/htmlbas.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx +index e37909aa87b9..1d2234394852 100644 +--- a/sw/source/filter/html/htmlbas.cxx ++++ b/sw/source/filter/html/htmlbas.cxx +@@ -236,6 +236,8 @@ void SwHTMLParser::InsertBasicDocEvent( const OUString& aEvent, const OUString& + if( !pDocSh ) + return; + ++ NotifyMacroEventRead(); ++ + OUString sEvent(convertLineEnd(rName, GetSystemLineEnd())); + OUString sScriptType; + if( EXTENDED_STYPE == eScrType ) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101933-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-101933-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101933-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101933-1.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,74 @@ +From 1a8d75cb038e0fa5b20f7ea176a82378abb2954c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 17:06:52 +0000 +Subject: [PATCH] keep each string of a Basic image string pool inside the pool +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +an image with string offsets outside its pool is not loaded + +Signed-off-by: Caolán McNamara +Change-Id: I55360ac5f348929f29514982fcf74c7ddb93961e +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13652 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +(cherry picked from commit fc0c18c508cd34bc8a17d534193de8992acdade0) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211625 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 0e705d4a0b812d671814e38db3ca2fc97560c8c8) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211719 +Tested-by: Xisco Fauli +--- + basic/source/classes/image.cxx | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx +index ec67430dff39..2b42ce3dced3 100644 +--- a/basic/source/classes/image.cxx ++++ b/basic/source/classes/image.cxx +@@ -222,9 +222,21 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) + mvStringOffsets[ i ] = static_cast(nOff); + } + r.ReadUInt32( nLen ); ++ if (r.good() ++ && (nLen > r.remainingSize() ++ || std::any_of(mvStringOffsets.begin(), mvStringOffsets.end(), ++ [nLen](sal_uInt32 nOff) { return nOff >= nLen; }))) ++ { ++ SAL_WARN("basic", "Parsing error: string pool of " << nLen ++ << " does not fit the record or its string offsets"); ++ MakeStrings(0); ++ bError = true; ++ break; ++ } + if (r.good()) + { +- pStrings.reset(new sal_Unicode[ nLen ]); ++ // The element past the pool ends the last string. ++ pStrings.reset(new sal_Unicode[ nLen + 1 ]()); + nStringSize = static_cast(nLen); + + if (GetToUnicodePoolData(r, nLen, nNext)) +@@ -232,13 +232,17 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) + } + else + { +- std::unique_ptr pByteStrings(new char[nLen]); ++ std::unique_ptr pByteStrings(new char[nLen]()); + r.ReadBytes(pByteStrings.get(), nLen); + for (size_t j = 0; j < mvStringOffsets.size(); j++) + { + sal_uInt16 nOff2 = static_cast(mvStringOffsets[j]); +- OUString aStr(pByteStrings.get() + nOff2, strlen(pByteStrings.get() + nOff2), eCharSet); +- memcpy(pStrings.get() + nOff2, aStr.getStr(), (aStr.getLength() + 1) * sizeof(sal_Unicode)); ++ const sal_uInt32 nAvail = nLen - nOff2; ++ const char* pByteString = pByteStrings.get() + nOff2; ++ OUString aStr(pByteString, strnlen(pByteString, nAvail), eCharSet); ++ std::copy_n(aStr.getStr(), ++ std::min(aStr.getLength() + 1, nAvail), ++ pStrings.get() + nOff2); + } + } + } diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-101933-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-101933-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-101933-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-101933-2.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,40 @@ +From 8e3f41f2cd4327e990b9b36837eaf857647ece30 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 27 Sep 2026 22:51:09 +0000 +Subject: [PATCH] check the class of a nested user type found by name in + SbiImage::Load +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ic9215a25384e07e6c082efbeb3b79dc4b56d158c +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13657 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +(cherry picked from commit 48162866845dd588ec0a85a9e9e93ed4477d7771) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211727 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 0f2d89705944d97aee45a17c560825d0df6591e8) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211794 +--- + basic/source/classes/image.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx +index 2b42ce3dced3..cc9f023ede43 100644 +--- a/basic/source/classes/image.cxx ++++ b/basic/source/classes/image.cxx +@@ -320,7 +320,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) + // nested user defined types + // declared before use, so it is ok to reference it by name on load + OUString aNestedTypeName = r.ReadUniOrByteString(eCharSet); +- SbxObject* pNestedTypeObj = static_cast< SbxObject* >( rTypes->Find( aNestedTypeName, SbxClassType::Object ) ); ++ SbxObject* pNestedTypeObj = dynamic_cast< SbxObject* >( rTypes->Find( aNestedTypeName, SbxClassType::Object ) ); + if (pNestedTypeObj) + { + SbxObjectRef pCloneObj = cloneTypeObjectImpl( *pNestedTypeObj ); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104007-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-104007-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104007-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104007-1.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,53 @@ +From 85e3ff48ac9b067a5455b35a4024723a0884c301 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 1 Oct 2026 07:40:29 +0000 +Subject: [PATCH] dbaccess: take JavaDriverClassPath only from the driver + configuration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +No UI ever wrote this setting into a database document. None of +the (631) .odb files in the crashtesting test corpus have it set. + +Signed-off-by: Caolán McNamara +Change-Id: I3d342f16dbd2d16da8a689a9526d90816967f738 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14009 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +(cherry picked from commit aae21cae8f686c0f4d43fcbee8b478aae8d60ff1) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211722 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit de88188e2cd8cd78ca46ace27c0a16a48ee538bb) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211792 +--- + dbaccess/CppunitTest_dbaccess_xmlimport.mk | 41 +++++++++++++++ + dbaccess/Module_dbaccess.mk | 4 ++ + .../qa/unit/data/document_java_classpath.odb | Bin 0 -> 2157 bytes + dbaccess/qa/unit/xmlimport.cxx | 49 ++++++++++++++++++ + dbaccess/source/filter/xml/xmlfilter.cxx | 5 +- + 5 files changed, 98 insertions(+), 1 deletion(-) + create mode 100644 dbaccess/CppunitTest_dbaccess_xmlimport.mk + create mode 100644 dbaccess/qa/unit/data/document_java_classpath.odb + create mode 100644 dbaccess/qa/unit/xmlimport.cxx + +diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx +index 9dc52f514558..470c63582b16 100644 +--- a/dbaccess/source/filter/xml/xmlfilter.cxx ++++ b/dbaccess/source/filter/xml/xmlfilter.cxx +@@ -588,7 +588,10 @@ void ODBFilter::setPropertyInfo() + Sequence aInfo; + if ( !m_aInfoSequence.empty() ) + aInfo = comphelper::containerToSequence(m_aInfoSequence); +- aDataSourceSettings.merge( ::comphelper::NamedValueCollection( aInfo ), true ); ++ ::comphelper::NamedValueCollection aDocumentSettings( aInfo ); ++ // The Java class path of a driver comes from the driver configuration, not the document. ++ aDocumentSettings.remove( u"JavaDriverClassPath"_ustr ); ++ aDataSourceSettings.merge( aDocumentSettings, true ); + + aDataSourceSettings >>= aInfo; + if ( aInfo.hasElements() ) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104007-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-104007-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104007-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104007-2.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,174 @@ +From 3a39596ed7f7a5b6c8a0a502777700a0d95d5e28 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 1 Oct 2026 19:40:56 +0000 +Subject: [PATCH] put calc pivot table database sources under link control +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +like refreshing database range imports, so a pivot table whose source +is a database document named by URL, rather than a registered data +source, waits until link updates are allowed before it opens it, and +counts as an external link so the update links infobar is offered + +Signed-off-by: Caolán McNamara +Change-Id: I90a921ef6c4346da53f4cb28f099518221bd87f7 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14114 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +(cherry picked from commit 0d27a2394257fe817160ed4092aecd4168b792e5) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211721 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 0eaa944aa5b0f743c9f58fb2f757eedc619773b9) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211790 +--- + sc/inc/document.hxx | 4 ++++ + sc/inc/dpobject.hxx | 6 +++++- + sc/source/core/data/document10.cxx | 18 +++++++++++++++++- + sc/source/core/data/dpobject.cxx | 30 ++++++++++++++++++++++++++++++ + 4 files changed, 56 insertions(+), 2 deletions(-) + +diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx +index b09f119ecc5e..09a37d3b0799 100644 +--- a/sc/inc/document.hxx ++++ b/sc/inc/document.hxx +@@ -904,6 +904,10 @@ + none. */ + SC_DLLPUBLIC bool HasDataProviderMappings() const; + ++ /** True when a pivot table takes its data from a database document named by URL rather than ++ from a registered data source. */ ++ bool HasDataPilotDatabaseLink() const; ++ + SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, OUString& rName, + bool* pSheetLocal = nullptr ) const; + +diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx +index c9e298c09836..4d134dc9de66 100644 +--- a/sc/inc/dpobject.hxx ++++ b/sc/inc/dpobject.hxx +@@ -411,7 +411,7 @@ public: + ScDPCache* getExistingCache( + sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand); + +- static css::uno::Reference createRowSet( ++ css::uno::Reference createRowSet( + sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand); + + void updateCache( +@@ -424,6 +424,10 @@ public: + ScDPCollection(const ScDPCollection& r); + ~ScDPCollection(); + ++ /** True when rDBName is the name of a data source registered in the user's configuration. ++ Any other name is the URL of a database document. */ ++ static bool IsRegisteredDatabase(const OUString& rDBName); ++ + TranslateId ReloadCache(const ScDPObject* pDPObj, o3tl::sorted_vector& rRefs); + bool ReloadGroupsInCache(const ScDPObject* pDPObj, o3tl::sorted_vector& rRefs); + SC_DLLPUBLIC bool GetReferenceGroups(const ScDPObject& rDPObj, const ScDPDimensionSaveData** pGroups) const; +diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx +index c9bf5d96c798..881970cce40c 100644 +--- a/sc/source/core/data/document10.cxx ++++ b/sc/source/core/data/document10.cxx +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + +@@ -1026,6 +1028,20 @@ + return mpDataMapper && !mpDataMapper->getDataSources().empty(); + } + ++bool ScDocument::HasDataPilotDatabaseLink() const ++{ ++ if (!pDPCollection) ++ return false; ++ ++ for (size_t i = 0, nCount = pDPCollection->GetCount(); i < nCount; ++i) ++ { ++ const ScImportSourceDesc* pDesc = (*pDPCollection)[i].GetImportSourceDesc(); ++ if (pDesc && !ScDPCollection::IsRegisteredDatabase(pDesc->aDBName)) ++ return true; ++ } ++ return false; ++} ++ + void ScDocument::StoreTabToCache(SCTAB nTab, SvStream& rStrm) const + { + const ScTable* pTab = FetchTable(nTab); +#FIXME. This function does not exist? Do we need the above then anyway? In what version/fix was +#HasExternalLinks introduced? That also is a cause why hunk #1 and #2 didn't aply cleanly in the +#first place... +#@@ -1059,7 +1075,7 @@ bool ScDocument::HasExternalLinks() const +# return true; +# +# if (HasLinkFormulaNeedingCheck() || HasDataProviderMappings() +#- || GetDocLinkManager().hasUpdatableLinks()) +#+ || HasDataPilotDatabaseLink() || GetDocLinkManager().hasUpdatableLinks()) +# return true; +# +# const ScDrawLayer* pDrawLayer = GetDrawLayer(); +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 16092c6ed3fd..71ff8eab5ddb 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -41,6 +41,7 @@ + #include + + #include ++#include + #include + #include + #include +@@ -3249,6 +3250,24 @@ bool ScDPCollection::DBType::less::operator() (const DBType& left, const DBType& + + ScDPCollection::DBCaches::DBCaches(ScDocument& rDoc) : mrDoc(rDoc) {} + ++bool ScDPCollection::IsRegisteredDatabase(const OUString& rDBName) ++{ ++ if (rDBName.isEmpty()) ++ return false; ++ ++ try ++ { ++ uno::Reference xContext ++ = sdb::DatabaseContext::create(comphelper::getProcessComponentContext()); ++ return xContext->hasRegisteredDatabase(rDBName); ++ } ++ catch (const uno::Exception&) ++ { ++ TOOLS_WARN_EXCEPTION("sc", "ScDPCollection::IsRegisteredDatabase"); ++ } ++ return false; ++} ++ + bool ScDPCollection::DBCaches::hasCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) const + { + DBType aType(nSdbType, rDBName, rCommand); +@@ -3304,6 +3323,17 @@ uno::Reference ScDPCollection::DBCaches::createRowSet( + sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) + { + uno::Reference xRowSet; ++ ++ // A database document named by URL is an external link, so it is opened only once the user ++ // allows link updates. ++ ScDocShell* pDocShell = mrDoc.GetDocumentShell(); ++ if (pDocShell && !pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate() ++ && !IsRegisteredDatabase(rDBName)) ++ { ++ SAL_WARN("sc", "data pilot source " << rDBName << " waits for link updates to be allowed"); ++ return xRowSet; ++ } ++ + try + { + xRowSet.set(comphelper::getProcessServiceFactory()->createInstance( +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104007-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-104007-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104007-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104007-3.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,47 @@ +From a80a37b8dc4cc89a1f45ba456d58ee441786372c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 9 Oct 2026 16:13:10 +0000 +Subject: [PATCH] dbaccess: take SystemProperties only from the driver + configuration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +as with JavaDriverClassPath, a database document no longer supplies them + +Signed-off-by: Caolán McNamara +Change-Id: Icfd1f0e32629e8968ceee0546e6ee12296fd5b75 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14960 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/15466 +(cherry picked from commit 1cb0c88c59759fad0956c6b1ab2383b2625faa05) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212422 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212486 +Reviewed-by: Adolfo Jayme Barrientos +(cherry picked from commit b8724f1ec896052986bb9ca7b71f4b0acfbbc6c5) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212575 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212811 +--- + dbaccess/source/filter/xml/xmlfilter.cxx | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx +index 9dbca841ef1c..54899d95e884 100644 +--- a/dbaccess/source/filter/xml/xmlfilter.cxx ++++ b/dbaccess/source/filter/xml/xmlfilter.cxx +@@ -589,8 +589,10 @@ + if ( !m_aInfoSequence.empty() ) + aInfo = comphelper::containerToSequence(m_aInfoSequence); + ::comphelper::NamedValueCollection aDocumentSettings( aInfo ); +- // The Java class path of a driver comes from the driver configuration, not the document. ++ // The Java class path of a driver and the Java system properties come from the driver ++ // configuration, not the document. + aDocumentSettings.remove( u"JavaDriverClassPath"_ustr ); ++ aDocumentSettings.remove( u"SystemProperties"_ustr ); + aDataSourceSettings.merge( aDocumentSettings, true ); + + aDataSourceSettings >>= aInfo; diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104692-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-104692-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104692-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104692-1.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,74 @@ +From 12eb4fe4abcfed548097d331d7c8db1acec384c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 1 Oct 2026 22:51:20 +0000 +Subject: [PATCH] hsqldb: treat an unset hsqldb.method_class_names like an + empty one +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I1c8b7e557e80a6859448a1feaa49cc8c9ee19a0e +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/14152 +Tested-by: Jenkins CPCI +--- + external/hsqldb/UnpackedTarball_hsqldb.mk | 1 + + .../patches/method-class-names-default.patch | 34 +++++++++++++++++++ + 2 files changed, 35 insertions(+) + create mode 100644 external/hsqldb/patches/method-class-names-default.patch + +diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk +index 8f311bac3d0c..c16d340b6ea7 100644 +--- a/external/hsqldb/UnpackedTarball_hsqldb.mk ++++ b/external/hsqldb/UnpackedTarball_hsqldb.mk +@@ -34,6 +34,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ + external/hsqldb/patches/lockfile.patch.1 \ + external/hsqldb/patches/allow-full-path-system-property.patch.1 \ + external/hsqldb/patches/stored-text-table.patch.1 \ ++ external/hsqldb/patches/method-class-names-default.patch \ + )) + + # vim: set noet sw=4 ts=4: +diff --git a/external/hsqldb/patches/method-class-names-default.patch b/external/hsqldb/patches/method-class-names-default.patch +new file mode 100644 +index 000000000000..c6b494ebce71 +--- /dev/null ++++ b/external/hsqldb/patches/method-class-names-default.patch +@@ -0,0 +1,34 @@ ++--- a/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java +++++ b/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java ++@@ -57,15 +57,13 @@ ++ ++ private static String hsqldb_method_class_names = ++ "hsqldb.method_class_names"; ++- private static HashSet accessibleJavaMethodNames; +++ private static HashSet accessibleJavaMethodNames = new HashSet(); ++ ++ static { ++ try { ++ String prop = System.getProperty(hsqldb_method_class_names); ++ ++ if (prop != null) { ++- accessibleJavaMethodNames = new HashSet(); ++- ++ String[] names = StringUtil.split(prop, ";"); ++ ++ for (int i = 0; i < names.length; i++) { ++@@ -76,11 +74,9 @@ ++ } ++ ++ /** ++- * If the system property "hsqldb.method_class_names" is not set, then ++- * static methods of all available Java classes can be accessed as functions ++- * in HSQLDB. If the property is set, then only the list of semicolon ++- * seperated method names becomes accessible. An empty property value means ++- * no class is accessible.

+++ * Only the semicolon seperated method names in the system property +++ * "hsqldb.method_class_names" are accessible. An empty or unset property +++ * means no class is accessible.

++ * ++ * A property value that ends with .* is treated as a wild card and allows ++ * access to all classe or method names formed by substitution of the +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104692-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-104692-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104692-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104692-2.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,46 @@ +From f17bf16876b0cdbc77b28b636807da818fef4616 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 1 Oct 2026 22:51:48 +0000 +Subject: [PATCH] start the JVM with an empty hsqldb.method_class_names +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +so a system hsqldb gets the same default as the bundled one + +Change-Id: Idc6ceec79f1e5ad3beaa80f236c6114ee9f3476a +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/14153 +Tested-by: Jenkins CPCI +--- + jvmfwk/source/framework.cxx | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx +index a71f7a0c1b3c..5c33e04647f0 100644 +--- a/jvmfwk/source/framework.cxx ++++ b/jvmfwk/source/framework.cxx +@@ -288,7 +288,7 @@ javaFrameworkError jfw_startVM( + //options dialog + std::unique_ptr sarJOptions( + new JavaVMOption[ +- arOptions.size() + (sUserClassPath.isEmpty() ? 2 : 3) + vmParams.size()]); ++ arOptions.size() + (sUserClassPath.isEmpty() ? 3 : 4) + vmParams.size()]); + JavaVMOption * arOpt = sarJOptions.get(); + if (! arOpt) + return JFW_E_ERROR; +@@ -312,6 +312,11 @@ javaFrameworkError jfw_startVM( + arOpt[index].extraInfo = nullptr; + ++index; + ++ // HSQLDB allows calls only to the Java methods named in this list, which starts empty. ++ arOpt[index].optionString = const_cast("-Dhsqldb.method_class_names="); ++ arOpt[index].extraInfo = nullptr; ++ ++index; ++ + //add the options set by options dialog + for (auto const & vmParam : vmParams) + { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104920.diff libreoffice-25.2.3/debian/patches/CVE-2026-104920.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104920.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104920.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,62 @@ +From 87c89bb00d574c88ce65aac8c71b9b09b56fe2b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 22 Sep 2026 14:41:49 +0000 +Subject: [PATCH] a Java class path entry has to be a plain local file URL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +with no host and an absolute path + +follow on from "translate only file URLs" +(Change-Id I41076b8af670d673bf29b14c02db0c66744feb0b) + +Signed-off-by: Caolán McNamara +Change-Id: I6025f3e627c51d83479e7f79a53841384b326442 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13322 +Tested-by: Jenkins CPCI +Reviewed-by: Stephan Bergmann +Reviewed-by: Michael Stahl +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13391 +--- + jvmaccess/source/classpath.cxx | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/jvmaccess/source/classpath.cxx b/jvmaccess/source/classpath.cxx +index bb0b16bc0220..b4c6331e6113 100644 +--- a/jvmaccess/source/classpath.cxx ++++ b/jvmaccess/source/classpath.cxx +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -79,7 +80,21 @@ jobjectArray jvmaccess::ClassPath::translateToUrls( + } + css::uno::Reference< css::uri::XUriReference > uriRef( + css::uri::UriReferenceFactory::create(context)->parse(url)); +- if (!uriRef.is() || !uriRef->getScheme().equalsIgnoreAsciiCase("file")) ++ bool bLocal = uriRef.is() && uriRef->getScheme().equalsIgnoreAsciiCase("file"); ++ if (bLocal && uriRef->hasAuthority()) ++ { ++ OUString aAuthority(uriRef->getAuthority()); ++ bLocal = aAuthority.isEmpty() || aAuthority.equalsIgnoreAsciiCase("localhost"); ++ } ++ if (bLocal) ++ { ++ // Java reads a path that starts with two separators as a network share name. ++ OUString aPath(rtl::Uri::decode(uriRef->getPath(), rtl_UriDecodeWithCharset, ++ RTL_TEXTENCODING_UTF8)); ++ bLocal = aPath.getLength() >= 2 && aPath[0] == '/' && aPath[1] != '/' ++ && aPath[1] != '\\'; ++ } ++ if (!bLocal) + { + throw css::lang::IllegalArgumentException( + "non-local Java class path entry: " + url, +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-104933.diff libreoffice-25.2.3/debian/patches/CVE-2026-104933.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-104933.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-104933.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,94 @@ +From b56bfd9213177b08e7da5f1e8cd76cbc1cfd6182 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 2 Oct 2026 18:39:15 +0000 +Subject: [PATCH] gstreamer: only autoplug demuxers for common self-contained + media formats +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +rather than dropping just the Adaptive ones + +Change-Id: Iba7d54b3c6ce49fa6c2713d3c9255f8d6319fdec +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/14210 +Tested-by: Jenkins CPCI +Reviewed-by: Michael Stahl +(cherry picked from commit a19df93839c759c1b18a4dc7738265349cb19326) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211952 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit f9e9e278a26cf08b5c69dff2965f984c905da1a1) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212179 +(cherry picked from commit 374e12122c3301ff4448a9c7a63518eddd98bcdc) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212200 +Reviewed-by: Ilmari Lauhakangas +Tested-by: Ilmari Lauhakangas +--- + avmedia/source/gstreamer/gstplayer.cxx | 28 +++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx +index 965981c648f2..81a4bb600fb2 100644 +--- a/avmedia/source/gstreamer/gstplayer.cxx ++++ b/avmedia/source/gstreamer/gstplayer.cxx +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -332,10 +333,13 @@ Player::Player() : + + if (mbInitialized) + { +- // Drop the "Adaptive" ones to rank none as a crude but simple way to +- // drop the cases that take a manifest to further resources that it +- // names. Otherwise an option is to follow more closely what browsers +- // probably do here and register a handler for fetching data. ++ // Only the demuxers for common self-contained media formats are autoplugged. Others, like ++ // the adaptive streaming and editing ones, can take a manifest that names further ++ // resources and build a pipeline to fetch them. ++ static constexpr std::string_view aAllowedDemuxers[] = { ++ "aiffparse", "asfdemux", "auparse", "avidemux", "dvdemux", "id3demux", ++ "matroskademux", "midiparse", "mpegpsdemux", "oggdemux", "qtdemux", "wavparse" ++ }; + GstRegistry* pRegistry = gst_registry_get(); + GList* pFactories = gst_registry_get_feature_list(pRegistry, GST_TYPE_ELEMENT_FACTORY); + for (GList* pItem = pFactories; pItem; pItem = pItem->next) +@@ -345,19 +349,25 @@ Player::Player() : + if (!pKlass) + continue; + +- OString aKlass(pKlass); +- bool bAdaptive = false; ++ std::string_view aKlass(pKlass); ++ bool bDemuxer = false; + for (sal_Int32 nIndex = 0; nIndex >= 0;) + { +- if (o3tl::getToken(aKlass, 0, '/', nIndex) == "Adaptive") ++ if (o3tl::starts_with(o3tl::getToken(aKlass, 0, '/', nIndex), "Demux")) + { +- bAdaptive = true; ++ bDemuxer = true; + break; + } + } ++ if (!bDemuxer) ++ continue; + +- if (bAdaptive) ++ std::string_view aName(gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(pFactory))); ++ if (std::find(std::begin(aAllowedDemuxers), std::end(aAllowedDemuxers), aName) ++ == std::end(aAllowedDemuxers)) ++ { + gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE(pFactory), GST_RANK_NONE); ++ } + } + gst_plugin_feature_list_free(pFactories); + } +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-108169.diff libreoffice-25.2.3/debian/patches/CVE-2026-108169.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-108169.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-108169.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,59 @@ +From bf767e906d2d90485632c11280fea7992da77a01 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 9 Oct 2026 15:52:38 +0000 +Subject: [PATCH] Related: tdf#106359 only take an http or https url from a web + query file +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +since: + +commit 099f9406b6657a03a37fbe5cedf7cb7da765d4aa +Date: Mon Mar 6 16:09:54 2017 +0300 + + tdf#106359: Open Web Query (.iqy) files + +a web query names a web page, so leave the argument alone when the +line found there is some other kind of url + +Signed-off-by: Caolán McNamara +Change-Id: Ie2501235c31d8256f8b84659f1dd18368157d87e +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14957 +Tested-by: Jenkins CPCI +Reviewed-by: Miklos Vajna +(cherry picked from commit e8e42c773264f0a70a39d164b34f440eefb05f16) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212218 +Reviewed-by: Xisco Fauli +Tested-by: Xisco Fauli +(cherry picked from commit 8b1b10e802a36463683aca9c3e9aeef4b5199cbf) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212410 +Tested-by: Jenkins +(cherry picked from commit c4d6d681499236935b3bd825efb6c6dcc7a5de8a) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/212457 +--- + desktop/source/app/cmdlineargs.cxx | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx +index e5f457fb7539..d06938c32b4f 100644 +--- a/desktop/source/app/cmdlineargs.cxx ++++ b/desktop/source/app/cmdlineargs.cxx +@@ -239,7 +239,13 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, CommandLineEvent curE + + stream.Close(); + +- arg = OStringToOUString(aResult, osl_getThreadTextEncoding()); ++ OUString aURL = OStringToOUString(aResult, osl_getThreadTextEncoding()); ++ // A web query names a web page. ++ INetProtocol eProtocol = INetURLObject(aURL).GetProtocol(); ++ if (eProtocol != INetProtocol::Http && eProtocol != INetProtocol::Https) ++ return curEvt; ++ ++ arg = aURL; + return CommandLineEvent::ForceNew; + } + catch (...) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-1.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,82 @@ +From a1d49525d34ce08fa34a5a77db5ce1d760229e45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 15 May 2026 11:37:21 +0000 +Subject: [PATCH] ofz: check buffer bounds before reading multi-byte CFF dict + operators +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I434749e74e29f0aa3cda76746440af64cc2965dd +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2693 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8187 +Reviewed-by: Mike Kaganski +(cherry picked from commit fa2ed413a2d1a6766d43ed1d094c2ce651c68ebb) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8274 +(cherry picked from commit 1857f907a6f8a5ff8154bbbf0790475040e809b7) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209855 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209956 +Reviewed-by: Michael Weghorn +Reviewed-by: Christian Lohmaier +Reviewed-by: Jonathan Clark +Tested-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 521fd74847d8..5e57cb67f908 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -913,6 +913,11 @@ void CffSubsetterContext::readDictOp() + if( nOpId != 12) + pCmdName = pDictOps[nOpId]; + else { ++ if (mpReadPtr >= mpReadEnd) { ++ SAL_WARN("vcl.fonts.cff", "truncated CFF dict op 12 escape"); ++ abandonDictParse(); ++ return; ++ } + const U8 nExtId = *(mpReadPtr++); + if (nExtId < 39) + pCmdName = pDictEscs[nExtId]; +@@ -1015,6 +1020,11 @@ void CffSubsetterContext::readDictOp() + read2push(); + } else if( c == 29 ) { // longint + ++mpReadPtr; // skip 29 ++ if (mpReadPtr + 4 > mpReadEnd) { ++ SAL_WARN("vcl.fonts.cff", "truncated CFF dict longint"); ++ abandonDictParse(); ++ return; ++ } + sal_Int32 nS32 = mpReadPtr[0] << 24; + nS32 += mpReadPtr[1] << 16; + nS32 += mpReadPtr[2] << 8; +@@ -1037,6 +1047,18 @@ void CffSubsetterContext::read2push() + + const U8*& p = mpReadPtr; + const U8 c = *p; ++ // total bytes consumed by this integer encoding, including the first ++ int nLen; ++ if (c == 28) nLen = 3; ++ else if (c <= 246) nLen = 1; ++ else if (c <= 254) nLen = 2; ++ else nLen = 5; ++ if (p + nLen > mpReadEnd) { ++ SAL_WARN("vcl.fonts.cff", "truncated CFF dict integer (c=" << int(c) << ")"); ++ abandonDictParse(); ++ push(0); ++ return; ++ } + if( c == 28 ) { + sal_Int16 nS16 = (p[1] << 8) + p[2]; + aVal = nS16; +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-10.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-10.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-10.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-10.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,49 @@ +From 12afa6aa8b518d1f9b18cf7cbdda6fa13478ac1f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 15 May 2026 14:47:43 +0100 +Subject: [PATCH] ofz: check for failure here too +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ib48de81390607918e58d200a65b869b18c58e8b1 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3162 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +(cherry picked from commit 51fa2756479e99d1fc8d804d50bfd969d582ebdd) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207731 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit f62f3a2552e90b464c37e50a2cdbed0ffcc09917) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207752 +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207782 +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207875 +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index b2597df3749e..710d0fccfd8e 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -1713,6 +1713,12 @@ RealType CffSubsetterContext::readRealVal() + constexpr S64 nDigitCap = (SAL_MAX_INT64 - 9) / 10; + for (;;) + { ++ if (mpReadPtr >= mpReadEnd) ++ { ++ SAL_WARN("vcl.fonts.cff", "truncated CFF dict real number"); ++ abandonDictParse(); ++ return 0.0; ++ } + const U8 c = *(mpReadPtr++); // read nibbles + // parse high nibble + const U8 nH = c >> 4U; +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-11.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-11.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-11.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-11.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,52 @@ +From 6f252ddc2ff067fbf15a155bd059376f7f217511 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 9 Jul 2026 13:04:51 +0000 +Subject: [PATCH] ofz#532839163 Integer-overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Id43a56b3b7b84d490a2e1f083b985f53d3a6dc86 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6576 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8376 +(cherry picked from commit fd90f5eb7e514a2975d034a1d9bc5cbd77cab820) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209856 +Reviewed-by: Xisco Fauli +Tested-by: Jenkins +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209958 +Reviewed-by: Jonathan Clark +Reviewed-by: Michael Weghorn +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 5e57cb67f908..0106d8f4b210 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -1850,12 +1850,12 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + case 4: nOfs2 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break; + } + ++ if (nOfs1 < 0 || nOfs2 < nOfs1) ++ return -1; + mpReadPtr = mpBasePtr + (nIndexBase + 2) + nDataOfsSz * (nDataCount + 1) + nOfs1; + mpReadEnd = mpReadPtr + (nOfs2 - nOfs1); +- assert( nOfs1 >= 0); +- assert( nOfs2 >= nOfs1); +- assert( mpReadPtr <= mpBaseEnd); +- assert( mpReadEnd <= mpBaseEnd); ++ if (mpReadPtr > mpBaseEnd || mpReadEnd > mpBaseEnd) ++ return -1; + return (nOfs2 - nOfs1); + } + +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-12.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-12.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-12.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-12.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,58 @@ +From 861c4e4d597ef7271e6705a52b40cae42833c19e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 30 Jul 2026 13:23:21 +0000 +Subject: [PATCH] vcl: skip the bytes reserved in the CFF DICT encoding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +they are neither operators nor operands, so step over them and +carry on reading the rest of the dict + +taken from the cff.cxx part of + + commit f799626f98b227d997c4d149ef3e7b0eab888406 + Author: Caolán McNamara + Date: Fri Apr 10 11:04:03 2026 +0100 + + revive sftfuzzer for a different code path + +Change-Id: Idd2d422c54707262bb76069640e7e251489debfe +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8415 +Tested-by: Jenkins CPCI +(cherry picked from commit a0343839bdc63b5d09e543b52e23fd71ce87a20e) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209858 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209959 +Reviewed-by: Jonathan Clark +Reviewed-by: Michael Weghorn +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 0106d8f4b210..5805bed83a95 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -1038,6 +1038,13 @@ void CffSubsetterContext::readDictOp() + // push value onto stack + ValType nVal = fReal; + push( nVal); ++ } else { ++ // bytes 22-27, 31 and 255 are reserved in CFF DICT encoding ++ // (Adobe Technical Note #5176, section 4 "DICT Data") ++ // https://adobe-type-tools.github.io/font-tech-notes/pdfs/5176.CFF.pdf ++ // skip to avoid infinite loop ++ SAL_WARN("vcl.fonts.cff", "undefined CFF DICT byte: " << int(c)); ++ ++mpReadPtr; + } + } + +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-13.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-13.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-13.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-13.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,597 @@ +From 40a70240c761720a749c7edbf7c87e6cfd7d3c39 Mon Sep 17 00:00:00 2001 +From: Khaled Hosny +Date: Sun, 8 Mar 2026 23:16:38 +0200 +Subject: [PATCH] Assert less in CFF to Type 1 code + +The top-level function already returns a boolean, make many of the +internal functions return false in case of failure and propagate that +instead of asserting in debug builds and continuing with bad input in +release builds. + +Change-Id: I00c5f9552eb114af1f406f5f1c2ead50fe6b97e4 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201228 +Tested-by: Jenkins +Reviewed-by: Khaled Hosny +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210539 +--- + vcl/source/fontsubset/cff.cxx | 214 +++++++++++++++++++++------------- + 1 file changed, 132 insertions(+), 82 deletions(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 4943aaa592d4..bc25bf334c8d 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -730,18 +730,18 @@ public: + explicit CffSubsetterContext( const U8* pBasePtr, int nBaseLen); + + bool initialCffRead(); +- void emitAsType1( class Type1Emitter&, ++ bool emitAsType1( class Type1Emitter&, + const sal_GlyphId* pGlyphIds, const U8* pEncoding, + int nGlyphCount, FontSubsetInfo& ); + + private: +- void convertCharStrings(const sal_GlyphId* pGlyphIds, int nGlyphCount, ++ bool convertCharStrings(const sal_GlyphId* pGlyphIds, int nGlyphCount, + std::vector& rCharStrings); + int convert2Type1Ops(CffLocal*, const U8* pType2Ops, int nType2Len, U8* pType1Ops, + size_t nType1Cap); +- void convertOneTypeOp(); +- void convertOneTypeEsc(); +- void callType2Subr( bool bGlobal, int nSubrNumber); ++ bool convertOneTypeOp(); ++ bool convertOneTypeEsc(); ++ bool callType2Subr( bool bGlobal, int nSubrNumber); + sal_Int32 getReadOfs() const { return static_cast(mpReadPtr - mpBasePtr);} + + // Abandon the current dict-data parse on malformed input. Advancing +@@ -948,7 +948,7 @@ void CffSubsetterContext::readDictOp() + //TODO: if( nStackIdx > 0) + int nInt = 0; + switch( *pCmdName) { +- default: SAL_WARN("vcl.fonts", "unsupported DictOp.type='" << *pCmdName << "'."); break; ++ default: SAL_WARN("vcl.fonts.cff", "unsupported DictOp.type='" << *pCmdName << "'."); break; + case 'b': // bool + nInt = popInt(); + switch( nOpId) { +@@ -1239,7 +1239,7 @@ void CffSubsetterContext::writeCurveTo( int nStackPos, + writeTypeOp( TYPE1OP::RCURVETO ); + } + +-void CffSubsetterContext::convertOneTypeOp() ++bool CffSubsetterContext::convertOneTypeOp() + { + const int nType2Op = *(mpReadPtr++); + +@@ -1247,7 +1247,8 @@ void CffSubsetterContext::convertOneTypeOp() + // convert each T2op + switch( nType2Op) { + case TYPE2OP::T2ESC: +- convertOneTypeEsc(); ++ if (!convertOneTypeEsc()) ++ return false; + break; + case TYPE2OP::HSTEM: + case TYPE2OP::VSTEM: +@@ -1329,12 +1330,13 @@ void CffSubsetterContext::convertOneTypeOp() + { + nInt = popInt(); + const bool bGlobal = (nType2Op == TYPE2OP::CALLGSUBR); +- callType2Subr( bGlobal, nInt); ++ if (!callType2Subr( bGlobal, nInt)) ++ return false; + } + break; + case TYPE2OP::RETURN: + // TODO: check that we are in a subroutine +- return; ++ return true; + case TYPE2OP::VMOVETO: + case TYPE2OP::HMOVETO: + if( mbNeedClose) +@@ -1469,91 +1471,107 @@ void CffSubsetterContext::convertOneTypeOp() + read2push(); + } else { + popAll2Write( nType2Op); +- assert(false && "TODO?"); ++ SAL_WARN("vcl.fonts.cff", "unhandled type2op " << nType2Op); ++ return false; + } + break; + } ++ return true; + } + +-void CffSubsetterContext::convertOneTypeEsc() ++bool CffSubsetterContext::convertOneTypeEsc() + { + const int nType2Esc = *(mpReadPtr++); + ValType* pTop = &mnValStack[ mnStackIdx-1]; + // convert each T2op + switch( nType2Esc) { + case TYPE2OP::AND: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + pTop[0] = static_cast(static_cast(pTop[0]) & static_cast(pTop[-1])); + --mnStackIdx; + break; + case TYPE2OP::OR: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + pTop[0] = static_cast(static_cast(pTop[0]) | static_cast(pTop[-1])); + --mnStackIdx; + break; + case TYPE2OP::NOT: +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + pTop[0] = ValType(pTop[0] == 0); + break; + case TYPE2OP::ABS: +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + if( pTop[0] >= 0) + break; + [[fallthrough]]; + case TYPE2OP::NEG: +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + pTop[0] = -pTop[0]; + break; + case TYPE2OP::ADD: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + pTop[0] += pTop[-1]; + --mnStackIdx; + break; + case TYPE2OP::SUB: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + pTop[0] -= pTop[-1]; + --mnStackIdx; + break; + case TYPE2OP::MUL: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + if( pTop[-1]) + pTop[0] *= pTop[-1]; + --mnStackIdx; + break; + case TYPE2OP::DIV: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + if( pTop[-1]) + pTop[0] /= pTop[-1]; + --mnStackIdx; + break; + case TYPE2OP::EQ: +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + pTop[0] = ValType(pTop[0] == pTop[-1]); + --mnStackIdx; + break; + case TYPE2OP::DROP: +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + --mnStackIdx; + break; + case TYPE2OP::PUT: { +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + const int nIdx = static_cast(pTop[0]); +- assert( nIdx >= 0 ); +- assert( nIdx < NMAXTRANS ); ++ if ( nIdx < 0 || nIdx >= NMAXTRANS ) ++ return false; + mnTransVals[ nIdx] = pTop[-1]; + mnStackIdx -= 2; + break; + } + case TYPE2OP::GET: { +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + const int nIdx = static_cast(pTop[0]); +- assert( nIdx >= 0 ); +- assert( nIdx < NMAXTRANS ); ++ if ( nIdx < 0 || nIdx >= NMAXTRANS ) ++ return false; + pTop[0] = mnTransVals[ nIdx ]; + break; + } + case TYPE2OP::IFELSE: { +- assert( mnStackIdx >= 4 ); ++ if ( mnStackIdx < 4 ) ++ return false; + if( pTop[-1] > pTop[0] ) + pTop[-3] = pTop[-2]; + mnStackIdx -= 3; +@@ -1570,37 +1588,41 @@ void CffSubsetterContext::convertOneTypeEsc() + break; + case TYPE2OP::DUP: + if ( mnStackIdx < 1 || mnStackIdx >= NMAXSTACK ) +- break; ++ return false; + pTop[+1] = pTop[0]; + ++mnStackIdx; + break; + case TYPE2OP::EXCH: { +- assert( mnStackIdx >= 2 ); ++ if ( mnStackIdx < 2 ) ++ return false; + const ValType nVal = pTop[0]; + pTop[0] = pTop[-1]; + pTop[-1] = nVal; + break; + } + case TYPE2OP::INDEX: { +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + const int nVal = static_cast(pTop[0]); +- assert( nVal >= 0 ); +- assert( nVal < mnStackIdx-1 ); ++ if ( nVal < 0 || nVal >= mnStackIdx-1 ) ++ return false; + pTop[0] = pTop[-1-nVal]; + break; + } + case TYPE2OP::ROLL: { +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 ) ++ return false; + const int nNum = static_cast(pTop[0]); +- assert( nNum >= 0); +- assert( nNum < mnStackIdx-2 ); +- (void)nNum; // TODO: implement ++ if ( nNum < 0 || nNum >= mnStackIdx-2 ) ++ return false; ++ // (void)nNum; // TODO: implement + // TODO: implement: const int nOfs = static_cast(pTop[-1]); + mnStackIdx -= 2; + break; + } + case TYPE2OP::HFLEX1: { +- assert( mnStackIdx == 9); ++ if ( mnStackIdx != 9 ) ++ return false; + + writeCurveTo( mnStackIdx, -9, -8, -7, -6, -5, 0); + writeCurveTo( mnStackIdx, -4, 0, -3, -2, -1, 0); +@@ -1610,7 +1632,8 @@ void CffSubsetterContext::convertOneTypeEsc() + } + break; + case TYPE2OP::HFLEX: { +- assert( mnStackIdx == 7); ++ if ( mnStackIdx != 7 ) ++ return false; + ValType* pX = &mnValStack[ mnStackIdx]; + + pX[+1] = -pX[-5]; // temp: +dy5==-dy2 +@@ -1622,7 +1645,8 @@ void CffSubsetterContext::convertOneTypeEsc() + } + break; + case TYPE2OP::FLEX: { +- assert( mnStackIdx == 13 ); ++ if ( mnStackIdx != 13 ) ++ return false; + writeCurveTo( mnStackIdx, -13, -12, -11, -10, -9, -8 ); + writeCurveTo( mnStackIdx, -7, -6, -5, -4, -3, -2 ); + // ignoring ValType nFlexDepth = mnValStack[ mnStackIdx-1 ]; +@@ -1630,7 +1654,8 @@ void CffSubsetterContext::convertOneTypeEsc() + } + break; + case TYPE2OP::FLEX1: { +- assert( mnStackIdx == 11 ); ++ if ( mnStackIdx != 11 ) ++ return false; + // write the first part of the flex1-hinted curve + writeCurveTo( mnStackIdx, -11, -10, -9, -8, -7, -6 ); + +@@ -1651,37 +1676,43 @@ void CffSubsetterContext::convertOneTypeEsc() + } + break; + default: +- SAL_WARN("vcl.fonts", "unhandled type2esc " << nType2Esc); +- assert( false); +- break; ++ SAL_WARN("vcl.fonts.cff", "unhandled type2esc " << nType2Esc); ++ return false; + } ++ return true; + } + +-void CffSubsetterContext::callType2Subr( bool bGlobal, int nSubrNumber) ++bool CffSubsetterContext::callType2Subr( bool bGlobal, int nSubrNumber) + { + const U8* const pOldReadPtr = mpReadPtr; + const U8* const pOldReadEnd = mpReadEnd; + + if( bGlobal ) { + nSubrNumber += mnGlobalSubrBias; +- seekIndexData( mnGlobalSubrBase, nSubrNumber); ++ if (seekIndexData( mnGlobalSubrBase, nSubrNumber) < 0) ++ return false; + } else { + nSubrNumber += mpCffLocal->mnLocalSubrBias; +- seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber); ++ if (seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber) < 0) ++ return false; + } + + // The CFF specification limits subroutine call nesting to 10 levels; + // deeper nesting would let cyclic subroutines recurse without bound. + if (mnSubrDepth >= 10) +- return; ++ return false; + ++mnSubrDepth; + + while (mpReadPtr < mpReadEnd && mpWritePtr <= mpWriteEnd) +- convertOneTypeOp(); ++ { ++ if (!convertOneTypeOp()) ++ return false; ++ } + --mnSubrDepth; + + mpReadPtr = pOldReadPtr; + mpReadEnd = pOldReadEnd; ++ return true; + } + + int CffSubsetterContext::convert2Type1Ops(CffLocal* pCffLocal, const U8* const pT2Ops, int nT2Len, +@@ -1723,8 +1754,10 @@ int CffSubsetterContext::convert2Type1Ops(CffLocal* pCffLocal, const U8* const p + mnHintSize=mnHorzHintSize=mnStackIdx=0; maCharWidth=-1;//####### + mnCntrMask = 0; + while (mpReadPtr < mpReadEnd && mpWritePtr <= mpWriteEnd) +- convertOneTypeOp(); +- ++ { ++ if (!convertOneTypeOp()) ++ return -1; ++ } + if (mpWritePtr > mpWriteEnd) + return -1; + if (maCharWidth != -1) +@@ -1847,7 +1880,8 @@ RealType CffSubsetterContext::readRealVal() + // prepare to access an element inside a CFF/CID index table + int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + { +- assert( (nIndexBase > 0) && (mpBasePtr + nIndexBase + 3 <= mpBaseEnd)); ++ if ( nIndexBase <= 0 || mpBasePtr + nIndexBase + 3 > mpBaseEnd) ++ return -1; + if( nDataIndex < 0) + return -1; + mpReadPtr = mpBasePtr + nIndexBase; +@@ -1860,7 +1894,7 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + return -1; + int nOfs1 = 0; + switch( nDataOfsSz) { +- default: SAL_WARN("vcl.fonts", "\tINVALID nDataOfsSz=" << nDataOfsSz); return -1; ++ default: SAL_WARN("vcl.fonts.cff", "\tINVALID nDataOfsSz=" << nDataOfsSz); return -1; + case 1: nOfs1 = mpReadPtr[0]; break; + case 2: nOfs1 = (mpReadPtr[0]<<8) + mpReadPtr[1]; break; + case 3: nOfs1 = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2]; break; +@@ -1900,7 +1934,7 @@ bool CffSubsetterContext::seekIndexEnd( int nIndexBase) + return false; + int nEndOfs = 0; + switch( nDataOfsSz) { +- default: SAL_WARN("vcl.fonts", "\tINVALID nDataOfsSz=" << nDataOfsSz); return false; ++ default: SAL_WARN("vcl.fonts.cff", "\tINVALID nDataOfsSz=" << nDataOfsSz); return false; + case 1: nEndOfs = mpReadPtr[0]; break; + case 2: nEndOfs = (mpReadPtr[0]<<8) + mpReadPtr[1]; break; + case 3: nEndOfs = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2];break; +@@ -1974,9 +2008,13 @@ bool CffSubsetterContext::initialCffRead() + const U8 nVerMinor = *(mpReadPtr++); + const U8 nHeaderSize = *(mpReadPtr++); + const U8 nOffsetSize = *(mpReadPtr++); +- // TODO: is the version number useful for anything else? +- assert( (nVerMajor == 1) && (nVerMinor == 0)); +- (void)(nVerMajor + nVerMinor + nOffsetSize); // avoid compiler warnings ++ if (nVerMajor != 1 || nVerMinor != 0) ++ { ++ SAL_WARN("vcl.fonts.cff", "Unsupported CFF version: " << int(nVerMajor) << "." << int(nVerMinor)); ++ return false; ++ } ++ if (!nOffsetSize) ++ return false; + + // prepare access to the NameIndex + mnNameIdxBase = nHeaderSize; +@@ -1990,10 +2028,12 @@ bool CffSubsetterContext::initialCffRead() + return false; + if( nTopDictCount) { + for( int i = 0; i < nTopDictCount; ++i) { +- seekIndexData( nTopDictBase, i); ++ if (seekIndexData( nTopDictBase, i) < 0) ++ return false; + while( mpReadPtr < mpReadEnd) + readDictOp(); +- assert( mpReadPtr == mpReadEnd); ++ if (mpReadPtr != mpReadEnd) ++ return false; + } + } + +@@ -2028,17 +2068,19 @@ bool CffSubsetterContext::initialCffRead() + return false; + if (o3tl::make_unsigned(mnFDAryCount) >= SAL_N_ELEMENTS(maCffLocal)) + { +- SAL_INFO("vcl.fonts", "CffSubsetterContext: too many CFF in font"); ++ SAL_INFO("vcl.fonts.cff", "CffContext: too many CFF in font"); + return false; + } + + // read FDArray details to get access to the PRIVDICTs + for( int i = 0; i < mnFDAryCount; ++i) { + mpCffLocal = &maCffLocal[i]; +- seekIndexData( mnFontDictBase, i); ++ if (seekIndexData( mnFontDictBase, i) < 0) ++ return false; + while( mpReadPtr < mpReadEnd) + readDictOp(); +- assert( mpReadPtr == mpReadEnd); ++ if (mpReadPtr != mpReadEnd) ++ return false; + } + } + +@@ -2103,8 +2145,9 @@ OString CffSubsetterContext::getString( int nStringID) + // access a CID's FDSelect table + int CffSubsetterContext::getFDSelect( int nGlyphIndex) const + { +- assert( nGlyphIndex >= 0); +- assert( nGlyphIndex < mnCharStrCount); ++ if ( nGlyphIndex < 0 || nGlyphIndex >= mnCharStrCount) ++ return -1; ++ + if( !mbCIDFont) + return 0; + +@@ -2144,11 +2187,10 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const + } + } break; + default: // invalid FDselect format +- SAL_WARN("vcl.fonts", "invalid CFF.FdselType=" << nFDSelFormat); ++ SAL_WARN("vcl.fonts.cff", "invalid CFF.FdselType=" << nFDSelFormat); + break; + } + +- assert( false); + return -1; + } + +@@ -2195,7 +2237,7 @@ int CffSubsetterContext::getGlyphSID( int nGlyphIndex) const + } + break; + default: +- SAL_WARN("vcl.fonts", "ILLEGAL CFF-Charset format " << nCSetFormat); ++ SAL_WARN("vcl.fonts.cff", "ILLEGAL CFF-Charset format " << nCSetFormat); + return -2; + } + +@@ -2440,7 +2482,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail, + maBuffer.append( pLineTail); + } + +-void CffSubsetterContext::convertCharStrings(const sal_GlyphId* pGlyphIds, int nGlyphCount, ++bool CffSubsetterContext::convertCharStrings(const sal_GlyphId* pGlyphIds, int nGlyphCount, + std::vector& rCharStrings) + { + // If we are doing extra glyphs used for seac operator, check for already +@@ -2450,7 +2492,8 @@ void CffSubsetterContext::convertCharStrings(const sal_GlyphId* pGlyphIds, int n + for (int i = 0; i < nGlyphCount; ++i) + { + const int nCffGlyphId = pGlyphIds[i]; +- assert((nCffGlyphId >= 0) && (nCffGlyphId < mnCharStrCount)); ++ if ((nCffGlyphId < 0) || (nCffGlyphId >= mnCharStrCount)) ++ return false; + + if (!bCheckDuplicates) + { +@@ -2464,24 +2507,28 @@ void CffSubsetterContext::convertCharStrings(const sal_GlyphId* pGlyphIds, int n + // get privdict context matching to the glyph + const int nFDSelect = getFDSelect(nCffGlyphId); + if (nFDSelect < 0) +- continue; ++ return false; + mpCffLocal = &maCffLocal[nFDSelect]; + + // convert the Type2op charstring to its Type1op counterpart + const int nT2Len = seekIndexData(mnCharStrBase, nCffGlyphId); +- assert(nT2Len > 0); ++ if (nT2Len <= 0) ++ return false; + + CharString aCharString; + const int nT1Len = convert2Type1Ops(mpCffLocal, mpReadPtr, nT2Len, aCharString.aOps, + std::size(aCharString.aOps)); ++ if (nT1Len < 0) ++ return false; + aCharString.nLen = nT1Len; + aCharString.nCffGlyphId = nCffGlyphId; + + rCharStrings.push_back(aCharString); + } ++ return true; + } + +-void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, ++bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, + const sal_GlyphId* pReqGlyphIds, const U8* pReqEncoding, + int nGlyphCount, FontSubsetInfo& rFSInfo) + { +@@ -2707,14 +2754,16 @@ void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, + // emit the CharStrings for the requested glyphs + std::vector aCharStrings; + mbDoSeac = true; +- convertCharStrings(pReqGlyphIds, nGlyphCount, aCharStrings); ++ if (!convertCharStrings(pReqGlyphIds, nGlyphCount, aCharStrings)) ++ return false; + + // The previous convertCharStrings might collect extra glyphs used in seac + // operator, convert them as well + if (!maExtraGlyphIds.empty()) + { + mbDoSeac = false; +- convertCharStrings(maExtraGlyphIds.data(), maExtraGlyphIds.size(), aCharStrings); ++ if (!convertCharStrings(maExtraGlyphIds.data(), maExtraGlyphIds.size(), aCharStrings)) ++ return false; + } + rEmitter.maBuffer.append( + "2 index /CharStrings " + OString::number(aCharStrings.size()) + " dict dup begin\n"); +@@ -2767,7 +2816,7 @@ void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, + rFSInfo.m_nFontType = rEmitter.mbPfbSubset ? FontType::TYPE1_PFB : FontType::TYPE1_PFA; + + if (rFSInfo.m_bFilled) +- return; ++ return true; + + rFSInfo.m_aFontBBox = { Point(static_cast(aFontBBox[0] * fXFactor), + static_cast(aFontBBox[1] * fYFactor)), +@@ -2780,24 +2829,25 @@ void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, + rFSInfo.m_nCapHeight = rFSInfo.m_nAscent; // for top-flat capital letters + + rFSInfo.m_aPSName = OUString( rEmitter.maSubsetName, strlen(rEmitter.maSubsetName), RTL_TEXTENCODING_UTF8 ); ++ ++ return true; + } + + bool FontSubsetInfo::CreateFontSubsetFromCff() + { + CffSubsetterContext aCff( mpInFontBytes, mnInByteLength); +- bool bRC = aCff.initialCffRead(); +- if (!bRC) +- return bRC; ++ if (!aCff.initialCffRead()) ++ return false; + + // emit Type1 subset from the CFF input + // TODO: also support CFF->CFF subsetting (when PDF-export and PS-printing need it) + const bool bPfbSubset(mnReqFontTypeMask & FontType::TYPE1_PFB); + Type1Emitter aType1Emitter( mpOutFile, bPfbSubset); + aType1Emitter.setSubsetName( maReqFontName.getStr() ); +- aCff.emitAsType1( aType1Emitter, ++ bool bRes = aCff.emitAsType1( aType1Emitter, + mpReqGlyphIds, mpReqEncodedIds, + mnReqGlyphCount, *this); +- return true; ++ return bRes; + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-2.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,56 @@ +From 9dd7789b4adcda4a09b168209e72ebec8a7c52bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 19 Jul 2026 10:55:32 +0000 +Subject: [PATCH] ofz#535775262 Out-of-memory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I4c7b8208df6ef7da663ad68aac5cdf119c96a3c4 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7262 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7272 +Reviewed-by: Miklos Vajna +(cherry picked from commit 7bbe72cd3bdced0c8617fc0246bea9ed5a09332f) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7633 +(cherry picked from commit 771e094dd840e33955dc8263225a2ed12242547f) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/9685 +(cherry picked from commit c7ed860db049b62eed1e26c9eed79e47f42e3454) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209860 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 8a4330439c866fdd59f85880426ccad562c82f9e) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210001 +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +Reviewed-by: Jonathan Clark +--- + vcl/source/fontsubset/cff.cxx | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 05efaf201c8d..4943aaa592d4 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -17,6 +17,7 @@ + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + ++#include + #include + #include + #include +@@ -2445,7 +2446,7 @@ void CffSubsetterContext::convertCharStrings(const sal_GlyphId* pGlyphIds, int n + // If we are doing extra glyphs used for seac operator, check for already + // converted glyphs. + bool bCheckDuplicates = !rCharStrings.empty(); +- rCharStrings.reserve(rCharStrings.size() + nGlyphCount); ++ rCharStrings.reserve(rCharStrings.size() + std::min(nGlyphCount, mpBaseEnd - mpBasePtr)); + for (int i = 0; i < nGlyphCount; ++i) + { + const int nCffGlyphId = pGlyphIds[i]; +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-3.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,85 @@ +From 6e6bb82dee83adfb21a74d239cfba51da1ed14cb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 29 Jul 2026 22:58:33 +0000 +Subject: [PATCH] ofz: cff, keep the operand index inside ValStack +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I4f6bafdb1a37df70d006d188368cccb69bf481de +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8158 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8191 +Reviewed-by: Michael Stahl +(cherry picked from commit c6bbeb56705e0212d9cfdf1cc9210e8f8bc833a9) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8391 +(cherry picked from commit 9e04fdeb1ff80b0a66c3317504b5154f2c3709d3) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209857 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209960 +Tested-by: Christian Lohmaier +Reviewed-by: Michael Weghorn +Reviewed-by: Christian Lohmaier +Reviewed-by: Jonathan Clark +--- + vcl/source/fontsubset/cff.cxx | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 5805bed83a95..2cca3159e083 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -794,9 +794,25 @@ private: + public: // TODO: is public really needed? + // accessing the value stack + // TODO: add more checks +- void push( ValType nVal) { mnValStack[ mnStackIdx++] = nVal;} ++ void push( ValType nVal) ++ { ++ if( mnStackIdx >= NMAXSTACK) { ++ SAL_WARN("vcl.fonts.cff", "too many CFF operands"); ++ abandonDictParse(); ++ return; ++ } ++ mnValStack[ mnStackIdx++] = nVal; ++ } + ValType popVal() { return ((mnStackIdx>0) ? mnValStack[ --mnStackIdx] : 0);} +- ValType getVal( int nIndex) const { return mnValStack[ nIndex];} ++ ValType getVal( int nIndex) const ++ { ++ if( nIndex < 0 || nIndex >= mnStackIdx) { ++ SAL_WARN("vcl.fonts.cff", "CFF operand index " << nIndex ++ << " outside the " << mnStackIdx << " operands pushed"); ++ return 0; ++ } ++ return mnValStack[ nIndex]; ++ } + int popInt(); + int size() const { return mnStackIdx;} + void clear() { mnStackIdx = 0;} +@@ -1542,6 +1558,8 @@ void CffSubsetterContext::convertOneTypeEsc() + break; + } + case TYPE2OP::RANDOM: ++ if ( mnStackIdx >= NMAXSTACK ) ++ break; + pTop[+1] = 1234; // TODO + ++mnStackIdx; + break; +@@ -1549,7 +1567,8 @@ void CffSubsetterContext::convertOneTypeEsc() + // TODO: implement + break; + case TYPE2OP::DUP: +- assert( mnStackIdx >= 1 ); ++ if ( mnStackIdx < 1 || mnStackIdx >= NMAXSTACK ) ++ break; + pTop[+1] = pTop[0]; + ++mnStackIdx; + break; +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-4.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-4.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-4.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-4.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,117 @@ +From 73e843bdbb741a84cfb9bb08d8206cc7d6cb7f06 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 14 Jul 2026 15:48:39 +0000 +Subject: [PATCH] ofz#533311278 stay within limits +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +where the base passed in was just taken from getReadOfs() the +reassignment of mpReadPtr in the helper is a no-op + +Signed-off-by: Caolán McNamara +Change-Id: I59566d4c1765dfd7c8906b465670a0f8bd815d50 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6645 +Reviewed-by: Miklos Vajna +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6882 +(cherry picked from commit 70ee40fd48b13bbedad12d096e96af6d898371a8) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/6969 +(cherry picked from commit 8db20269a8095a81bc0a8c0bfe36342a7fc6ff4a) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209843 +Tested-by: Xisco Fauli +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209972 +Reviewed-by: Jonathan Clark +Tested-by: Christian Lohmaier +Reviewed-by: Michael Weghorn +--- + vcl/source/fontsubset/cff.cxx | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index d8274d028c19..cae31b69ee9e 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -768,6 +768,7 @@ private: + + int seekIndexData( int nIndexBase, int nDataIndex); + void seekIndexEnd( int nIndexBase); ++ bool readIndexCount( int nIndexBase, int& rCount); + + CffLocal maCffLocal[256]; + CffLocal* mpCffLocal; +@@ -1909,6 +1910,16 @@ void CffSubsetterContext::seekIndexEnd( int nIndexBase) + assert( mpReadEnd <= mpBaseEnd); + } + ++// read the 16-bit entry count at the start of a CFF/CID index table ++bool CffSubsetterContext::readIndexCount( int nIndexBase, int& rCount) ++{ ++ if (nIndexBase <= 0 || sal_Int64(nIndexBase) + 2 > mpBaseEnd - mpBasePtr) ++ return false; ++ mpReadPtr = mpBasePtr + nIndexBase; ++ rCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; ++ return true; ++} ++ + // initialize FONTDICT specific values + CffLocal::CffLocal() + : mnPrivDictBase( 0) +@@ -1968,7 +1979,9 @@ bool CffSubsetterContext::initialCffRead() + + // get the TopDict index + const sal_Int32 nTopDictBase = getReadOfs(); +- const int nTopDictCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; ++ int nTopDictCount; ++ if (!readIndexCount( nTopDictBase, nTopDictCount)) ++ return false; + if( nTopDictCount) { + for( int i = 0; i < nTopDictCount; ++i) { + seekIndexData( nTopDictBase, i); +@@ -1984,7 +1997,8 @@ bool CffSubsetterContext::initialCffRead() + + // prepare access to the GlobalSubr index + mnGlobalSubrBase = getReadOfs(); +- mnGlobalSubrCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; ++ if (!readIndexCount( mnGlobalSubrBase, mnGlobalSubrCount)) ++ return false; + mnGlobalSubrBias = (mnGlobalSubrCount<1240)?107:(mnGlobalSubrCount<33900)?1131:32768; + // skip past the last GlobalSubr entry + // seekIndexEnd( mnGlobalSubrBase); +@@ -1996,15 +2010,15 @@ bool CffSubsetterContext::initialCffRead() + // get/skip FDSelect (CID only) data + + // prepare access to the CharStrings index (we got the base from TOPDICT) +- mpReadPtr = mpBasePtr + mnCharStrBase; +- mnCharStrCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; ++ if (!readIndexCount( mnCharStrBase, mnCharStrCount)) ++ return false; + // seekIndexEnd( mnCharStrBase); + + // read the FDArray index (CID only) + if( mbCIDFont) { + // assert( mnFontDictBase == tellRel()); +- mpReadPtr = mpBasePtr + mnFontDictBase; +- mnFDAryCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; ++ if (!readIndexCount( mnFontDictBase, mnFDAryCount)) ++ return false; + if (o3tl::make_unsigned(mnFDAryCount) >= SAL_N_ELEMENTS(maCffLocal)) + { + SAL_INFO("vcl.fonts", "CffSubsetterContext: too many CFF in font"); +@@ -2041,8 +2055,9 @@ bool CffSubsetterContext::initialCffRead() + if( mpCffLocal->mnLocalSubrOffs) { + // read LocalSubrs summary + mpCffLocal->mnLocalSubrBase = mpCffLocal->mnPrivDictBase + mpCffLocal->mnLocalSubrOffs; +- mpReadPtr = mpBasePtr + mpCffLocal->mnLocalSubrBase; +- const int nSubrCount = (mpReadPtr[0] << 8) + mpReadPtr[1]; ++ int nSubrCount; ++ if (!readIndexCount( mpCffLocal->mnLocalSubrBase, nSubrCount)) ++ return false; + mpCffLocal->mnLocalSubrBias = (nSubrCount<1240)?107:(nSubrCount<33900)?1131:32768; + // seekIndexEnd( mpCffLocal->mnLocalSubrBase); + } +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-5.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-5.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-5.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-5.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,61 @@ +From 0db14b3c547bb37644b313f76732d59125c26877 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 15 May 2026 11:23:59 +0000 +Subject: [PATCH] ofz: check buffer bounds before reading offsets in CFF + seekIndexData +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Same pattern as: + +commit 304208502164c07df8eb5a3677cb445ab0965f0e +Date: Fri May 15 08:38:40 2026 +0100 + + ofz#513301090 UNKNOWN READ + +Signed-off-by: Caolán McNamara +Change-Id: I841619bc2f6eb2cb1a599f8eee2be9a75c68d2ca +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2695 +Tested-by: Jenkins CPCI +(cherry picked from commit 7c237925e474326f3c8dea179264b60d835145d7) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207724 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 99f5d81441424ab097b06843c960102c90ea9894) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207739 +(cherry picked from commit 70eccad0a34f419a88fafdc585f061d6ff495da3) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207744 +Reviewed-by: Michael Weghorn +Tested-by: Ilmari Lauhakangas +Reviewed-by: Ilmari Lauhakangas +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index b02643c78497..c6766bac3da2 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -1806,6 +1806,8 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + return -1; + const int nDataOfsSz = mpReadPtr[2]; + mpReadPtr += 3 + (nDataOfsSz * nDataIndex); ++ if (mpReadPtr + nDataOfsSz > mpBaseEnd) ++ return -1; + int nOfs1 = 0; + switch( nDataOfsSz) { + default: SAL_WARN("vcl.fonts", "\tINVALID nDataOfsSz=" << nDataOfsSz); return -1; +@@ -1815,6 +1817,8 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + case 4: nOfs1 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break; + } + mpReadPtr += nDataOfsSz; ++ if (mpReadPtr + nDataOfsSz > mpBaseEnd) ++ return -1; + + int nOfs2 = 0; + switch( nDataOfsSz) { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-6.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-6.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-6.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-6.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,99 @@ +From 6a369c30949ffc11ded31e2ce4239335b411e850 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 15 May 2026 09:16:02 +0100 +Subject: [PATCH] ofz#513277199 Integer-overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I8a07f47f382502ab24670a270e8cd23a888f1ba4 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2656 +Reviewed-by: Michael Stahl +Tested-by: Jenkins CPCI +(cherry picked from commit 6eb214dbe24ac7c1cde3fe8a6ce242f2d7e24151) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207713 +Reviewed-by: Xisco Fauli +Tested-by: Xisco Fauli +(cherry picked from commit 073913a2cc102f14aa54eaf9d1ecfa3bd44656fb) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207728 +Tested-by: Jenkins +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207781 +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207874 +Reviewed-by: Christian Lohmaier +Tested-by: Christian Lohmaier +--- + include/sal/log-areas.dox | 1 + + vcl/source/fontsubset/cff.cxx | 25 +++++++++++++++++++++++-- + 2 files changed, 24 insertions(+), 2 deletions(-) + +diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox +index 36e7d8a71c7a..c63d7650e5fe 100644 +--- a/include/sal/log-areas.dox ++++ b/include/sal/log-areas.dox +@@ -501,6 +501,7 @@ certain functionality. + @li @c vcl.filter.webp + @li @c vcl.fonts - font-specific code + @li @c vcl.fonts.detail ++@li @c vcl.fonts.cff - CFF font subsetting-specific code + @li @c vcl.gdi - the GDI part of VCL, devices, bitmaps, etc. + @li @c vcl.gdi.wndproc - Windows Procedure part of VCL + @li @c vcl.gdi.fontmetric +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index 897287711dba..3c62880a8b08 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -743,6 +743,11 @@ + void callType2Subr( bool bGlobal, int nSubrNumber); + sal_Int32 getReadOfs() const { return static_cast(mpReadPtr - mpBasePtr);} + ++ // Abandon the current dict-data parse on malformed input. Advancing ++ // mpReadPtr past mpReadEnd exits the parse loop, and trips the mpReadPtr ++ // != mpReadEnd post-check so flags as a parse failure. ++ void abandonDictParse() { mpReadPtr = mpReadEnd + 1; } ++ + // Abandon the charstring conversion when the output buffer is full. + // callType2Subr does not restore mpWritePtr, so this stays in effect when + // the buffer fills inside a subroutine. +@@ -1662,11 +1667,21 @@ RealType CffSubsetterContext::readRealVal() + int nExpSign = 0; + S64 nNumber = 0; + RealType fReal = +1.0; +- for(;;){ ++ // nNumber * 10 + 9 must fit in S64; anything beyond is a malformed ++ constexpr S64 nDigitCap = (SAL_MAX_INT64 - 9) / 10; ++ for (;;) ++ { + const U8 c = *(mpReadPtr++); // read nibbles + // parse high nibble + const U8 nH = c >> 4U; +- if( nH <= 9) { ++ if (nH <= 9) ++ { ++ if (nNumber > nDigitCap) ++ { ++ SAL_WARN("vcl.fonts.cff", "CFF real number overflow"); ++ abandonDictParse(); ++ return 0.0; ++ } + nNumber = nNumber * 10 + nH; + --nExpVal; + } else if( nH == 10) { // comma +@@ -1689,6 +1704,12 @@ RealType CffSubsetterContext::readRealVal() + // parse low nibble + const U8 nL = c & 0x0F; + if( nL <= 9) { ++ if (nNumber > nDigitCap) ++ { ++ SAL_WARN("vcl.fonts.cff", "CFF real number overflow"); ++ abandonDictParse(); ++ return 0.0; ++ } + nNumber = nNumber * 10 + nL; + --nExpVal; + } else if( nL == 10) { // comma +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-7.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-7.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-7.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-7.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,96 @@ +From c9287fef9b41ca4493fae95b3d44dc992421f10e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 15 May 2026 08:38:40 +0100 +Subject: [PATCH] ofz#513301090 UNKNOWN READ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I8d9dde7634b770cb7642bed42c85b36527921f4b +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2653 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8184 +Reviewed-by: Mike Kaganski +(cherry picked from commit f685107dc8c93ee92761b0418a4c0e37b4f97174) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8249 +(cherry picked from commit 760a5b7c6647788ef4608a927e451d5528b07774) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209853 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209974 +Reviewed-by: Jonathan Clark +Reviewed-by: Michael Weghorn +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index cae31b69ee9e..05efaf201c8d 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -767,7 +767,7 @@ private: + sal_Int32 mnCntrMask; + + int seekIndexData( int nIndexBase, int nDataIndex); +- void seekIndexEnd( int nIndexBase); ++ bool seekIndexEnd( int nIndexBase); + bool readIndexCount( int nIndexBase, int& rCount); + + CffLocal maCffLocal[256]; +@@ -1887,27 +1887,32 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex) + } + + // skip over a CFF/CID index table +-void CffSubsetterContext::seekIndexEnd( int nIndexBase) ++bool CffSubsetterContext::seekIndexEnd( int nIndexBase) + { +- assert( (nIndexBase > 0) && (mpBasePtr + nIndexBase + 3 <= mpBaseEnd)); ++ if (nIndexBase <= 0 || mpBasePtr + nIndexBase + 3 > mpBaseEnd) ++ return false; + mpReadPtr = mpBasePtr + nIndexBase; + const int nDataCount = (mpReadPtr[0]<<8) + mpReadPtr[1]; + const int nDataOfsSz = mpReadPtr[2]; + mpReadPtr += 3 + nDataOfsSz * nDataCount; +- assert( mpReadPtr <= mpBaseEnd); ++ if (mpReadPtr + nDataOfsSz > mpBaseEnd) ++ return false; + int nEndOfs = 0; + switch( nDataOfsSz) { +- default: SAL_WARN("vcl.fonts", "\tINVALID nDataOfsSz=" << nDataOfsSz); return; ++ default: SAL_WARN("vcl.fonts", "\tINVALID nDataOfsSz=" << nDataOfsSz); return false; + case 1: nEndOfs = mpReadPtr[0]; break; + case 2: nEndOfs = (mpReadPtr[0]<<8) + mpReadPtr[1]; break; + case 3: nEndOfs = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2];break; + case 4: nEndOfs = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break; + } ++ if (nEndOfs < 0) ++ return false; + mpReadPtr += nDataOfsSz; + mpReadPtr += nEndOfs - 1; + mpReadEnd = mpBaseEnd; +- assert( nEndOfs >= 0); +- assert( mpReadEnd <= mpBaseEnd); ++ if (mpReadPtr > mpBaseEnd) ++ return false; ++ return true; + } + + // read the 16-bit entry count at the start of a CFF/CID index table +@@ -1993,7 +1998,8 @@ bool CffSubsetterContext::initialCffRead() + + // prepare access to the String index + mnStringIdxBase = getReadOfs(); +- seekIndexEnd( mnStringIdxBase); ++ if (!seekIndexEnd( mnStringIdxBase)) ++ return false; + + // prepare access to the GlobalSubr index + mnGlobalSubrBase = getReadOfs(); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-8.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-8.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-8.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-8.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,45 @@ +From 83f220340e4e91d560c1f7417b6fdf8385d51864 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 21 May 2026 16:55:18 +0100 +Subject: [PATCH] ofz: initialCffRead fails during smoketest +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I9f8d71788cfd9e42a668670d08efd3c774b8455a +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3085 +Tested-by: Noel Grandin +Reviewed-by: Noel Grandin +(cherry picked from commit 15d96dba8b96f1248840da1bafa3b564b2ad2a95) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205514 +Tested-by: Jenkins +Reviewed-by: Xisco Fauli +(cherry picked from commit 0bda4b8824202ff97b32179bd88df538e0a573a1) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207779 +Tested-by: Ilmari Lauhakangas +Reviewed-by: Michael Weghorn +Reviewed-by: Ilmari Lauhakangas +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index c6766bac3da2..521fd74847d8 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -1901,7 +1901,9 @@ CffGlobal::CffGlobal() + + bool CffSubsetterContext::initialCffRead() + { +- // get the CFFHeader ++ // Adobe Technical Note #5176 section 6 "Header": major, minor, hdrSize, offSize ++ if (mpBaseEnd - mpBasePtr < 4) ++ return false; + mpReadPtr = mpBasePtr; + const U8 nVerMajor = *(mpReadPtr++); + const U8 nVerMinor = *(mpReadPtr++); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18563-9.diff libreoffice-25.2.3/debian/patches/CVE-2026-18563-9.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18563-9.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18563-9.diff 2026-11-15 12:40:47.000000000 +0000 @@ -0,0 +1,106 @@ +From 9bf790522876b7813b0512a7fe3b3144e514f4ee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 19 Jul 2026 11:31:57 +0100 +Subject: [PATCH] ofz#536319253 stay within buffer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ia39562c232183a799415e5fe3a351a57a68a6f19 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7261 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7273 +Reviewed-by: Miklos Vajna +(cherry picked from commit 0d43de913089afdb4f8153fc74684dbc013db733) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7632 +(cherry picked from commit b5086bd01e2d40cdbe3cb5116fa8a84c1d81ead4) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/9684 +(cherry picked from commit c45a9221b58c0093e24dd2fd084a9aca86db2621) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209859 +Reviewed-by: Xisco Fauli +Tested-by: Jenkins +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209971 +Reviewed-by: Jonathan Clark +Reviewed-by: Michael Weghorn +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +--- + vcl/source/fontsubset/cff.cxx | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx +index c21dd7be7278..d8274d028c19 100644 +--- a/vcl/source/fontsubset/cff.cxx ++++ b/vcl/source/fontsubset/cff.cxx +@@ -2087,14 +2087,20 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const + return 0; + + const U8* pReadPtr = mpBasePtr + mnFDSelectBase; ++ if( pReadPtr < mpBasePtr || pReadPtr >= mpBaseEnd) ++ return -1; + const U8 nFDSelFormat = *(pReadPtr++); + switch( nFDSelFormat) { + case 0: { // FDSELECT format 0 ++ if( pReadPtr + nGlyphIndex >= mpBaseEnd) ++ return -1; + pReadPtr += nGlyphIndex; + const U8 nFDIdx = *(pReadPtr++); + return nFDIdx; + } //break; + case 3: { // FDSELECT format 3 ++ if( pReadPtr + 4 > mpBaseEnd) ++ return -1; + const U16 nRangeCount = (pReadPtr[0]<<8) + pReadPtr[1]; + assert( nRangeCount > 0); + assert( nRangeCount <= mnCharStrCount); +@@ -2104,6 +2110,8 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const + pReadPtr += 4; + // TODO? binary search + for( int i = 0; i < nRangeCount; ++i) { ++ if( pReadPtr + 3 > mpBaseEnd) ++ return -1; + const U8 nFDIdx = pReadPtr[0]; + const U16 nNext = (pReadPtr[1]<<8) + pReadPtr[2]; + assert( nPrev < nNext); +@@ -2133,6 +2141,8 @@ int CffSubsetterContext::getGlyphSID( int nGlyphIndex) const + + // get the SID/CID from the Charset table + const U8* pReadPtr = mpBasePtr + mnCharsetBase; ++ if( pReadPtr < mpBasePtr || pReadPtr >= mpBaseEnd) ++ return -1; + const U8 nCSetFormat = *(pReadPtr++); + int nGlyphsToSkip = nGlyphIndex - 1; + switch( nCSetFormat) { +@@ -2142,6 +2152,8 @@ int CffSubsetterContext::getGlyphSID( int nGlyphIndex) const + break; + case 1: // charset format 1 + while( nGlyphsToSkip >= 0) { ++ if( pReadPtr + 3 > mpBaseEnd) ++ return -1; + const int nLeft = pReadPtr[2]; + if( nGlyphsToSkip <= nLeft) + break; +@@ -2151,6 +2163,8 @@ int CffSubsetterContext::getGlyphSID( int nGlyphIndex) const + break; + case 2: // charset format 2 + while( nGlyphsToSkip >= 0) { ++ if( pReadPtr + 4 > mpBaseEnd) ++ return -1; + const int nLeft = (pReadPtr[2]<<8) + pReadPtr[3]; + if( nGlyphsToSkip <= nLeft) + break; +@@ -2163,6 +2177,8 @@ int CffSubsetterContext::getGlyphSID( int nGlyphIndex) const + return -2; + } + ++ if( pReadPtr + 2 > mpBaseEnd) ++ return -1; + int nSID = (pReadPtr[0]<<8) + pReadPtr[1]; + nSID += nGlyphsToSkip; + // NOTE: for CID-fonts the resulting SID is interpreted as CID +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18564.diff libreoffice-25.2.3/debian/patches/CVE-2026-18564.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18564.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18564.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,149 @@ +From b8c2fa6df6fb7075aaa06b883498e08c0fbad45b Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Thu, 30 Jul 2026 13:49:58 +0200 +Subject: [PATCH] oox,svl,vcl: use more appropriate random numbers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Michael Stahl +Change-Id: I9d6f200cc5a146f46dca64af270b77d0ce6abf6b +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8174 +Tested-by: Jenkins CPCI +Reviewed-by: Caolán McNamara +(cherry picked from commit 52ba487c3d84a89a027c3130bc86afdcfe57a860) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8261 +Reviewed-by: Stephan Bergmann +(cherry picked from commit 63ab1f905bddbac4871a246d61aa59d09f122e5c) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8277 +(cherry picked from commit 396747a0e319943e7d411b0d6bc8d8abcc3e4f19) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209298 +Tested-by: Christian Lohmaier +Reviewed-by: Christian Lohmaier +Reviewed-by: Xisco Fauli +Reviewed-by: Dan Williams +--- + oox/source/crypto/AgileEngine.cxx | 11 ++++++----- + svl/source/crypto/cryptosign.cxx | 8 +++++--- + vcl/source/pdf/PDFEncryptor.cxx | 1 - + vcl/source/pdf/PDFEncryptorR6.cxx | 8 +++++--- + 4 files changed, 16 insertions(+), 12 deletions(-) + +diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx +index 9599b492e5b9..c173ca287a51 100644 +--- a/oox/source/crypto/AgileEngine.cxx ++++ b/oox/source/crypto/AgileEngine.cxx +@@ -20,12 +20,12 @@ + + #include + #include +-#include + #include + #include + #include + + #include ++#include + #include + #include + #include +@@ -318,12 +318,13 @@ namespace + + bool generateBytes(std::vector & rBytes, sal_Int32 nSize) + { ++ assert(0 <= nSize && o3tl::make_unsigned(nSize) <= rBytes.size()); ++ if (nSize <= 0) ++ return false; ++ + size_t nMax = std::min(rBytes.size(), size_t(nSize)); + +- for (size_t i = 0; i < nMax; ++i) +- { +- rBytes[i] = sal_uInt8(comphelper::rng::uniform_uint_distribution(0, 0xFF)); +- } ++ rtl_random_getBytes(nullptr, rBytes.data(), nMax); + + return true; + } +diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx +index 1b9132fd6e0c..b245de24f103 100644 +--- a/svl/source/crypto/cryptosign.cxx ++++ b/svl/source/crypto/cryptosign.cxx +@@ -22,6 +22,7 @@ + #endif + + #include ++#include + #include + #include + #include +@@ -30,7 +31,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -1086,7 +1086,8 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) + src.reqPolicy.data = nullptr; + src.reqPolicy.len = 0; + +- unsigned int nNonce = comphelper::rng::uniform_uint_distribution(0, SAL_MAX_UINT32); ++ unsigned int nNonce; ++ rtl_random_getBytes(nullptr, &nNonce, sizeof(nNonce)); + src.nonce.type = siUnsignedInteger; + src.nonce.data = reinterpret_cast(&nNonce); + src.nonce.len = sizeof(nNonce); +@@ -1481,7 +1482,8 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) + CMSG_SIGNER_INFO *pDecodedSignerInfo = reinterpret_cast(pDecodedSignerInfoBuf.get()); + + CRYPT_TIMESTAMP_PARA aTsPara; +- unsigned int nNonce = comphelper::rng::uniform_uint_distribution(0, SAL_MAX_UINT32); ++ unsigned int nNonce; ++ rtl_random_getBytes(nullptr, &nNonce, sizeof(nNonce)); + + aTsPara.pszTSAPolicyId = nullptr; + aTsPara.fRequestCerts = TRUE; +diff --git a/vcl/source/pdf/PDFEncryptor.cxx b/vcl/source/pdf/PDFEncryptor.cxx +index 315a2c6e27cc..86ab23ccbd03 100644 +--- a/vcl/source/pdf/PDFEncryptor.cxx ++++ b/vcl/source/pdf/PDFEncryptor.cxx +@@ -13,7 +13,6 @@ + #include + #include + #include +-#include + #include + #include + +#FIXME. Substantially different. Does this apply to 25.2.3? +#diff --git a/vcl/source/pdf/PDFEncryptorR6.cxx b/vcl/source/pdf/PDFEncryptorR6.cxx +#index 71e2b6e9f16a..6973bbd18a65 100644 +#--- a/vcl/source/pdf/PDFEncryptorR6.cxx +#+++ b/vcl/source/pdf/PDFEncryptorR6.cxx +#@@ -12,7 +12,7 @@ +# #include +# #include +# #include +#-#include +#+#include +# +# using namespace css; +# +#@@ -38,8 +38,10 @@ void generateBytes(std::vector& rBytes, size_t nSize) +# { +# rBytes.resize(nSize); +# +#- for (size_t i = 0; i < rBytes.size(); ++i) +#- rBytes[i] = sal_uInt8(comphelper::rng::uniform_uint_distribution(0, 0xFF)); +#+ if (rBytes.empty()) +#+ return; +#+ +#+ rtl_random_getBytes(nullptr, rBytes.data(), rBytes.size()); +# } +# +# } // end anonymous +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18565.diff libreoffice-25.2.3/debian/patches/CVE-2026-18565.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18565.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18565.diff 2026-11-15 16:22:00.000000000 +0000 @@ -0,0 +1,623 @@ +From cef6ff70716bf53bc2a38bb7ca8bac5b84765346 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 30 Jul 2026 14:39:44 +0000 +Subject: [PATCH] pass a referer through + setSvxBrushItemAsFillAttributesToTargetSet +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +SvxBrushItem::GetGraphic wants the name of the document the brush came +from, so take it as an argument and hand in SwDoc::GetLinkReferer +wherever a document is at hand, the Writer style, frame and background +shell paths included. + +The dialog and example-window callers pass the name of the active +document shell through a new svx helper getActiveDocumentLinkReferer. + +The hand-rolled copies of the GetPersist, HasName, GetMedium GetName +sequence elsewhere in sw now call SwDoc::GetLinkReferer too. + +Change-Id: I8693d27869baed79962b2d5bdcb7b7e2c63227bb +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8200 +Reviewed-by: Stephan Bergmann +Tested-by: Jenkins CPCI +(cherry picked from commit 18f91ac71710027479dfe9f206ae2207bad8f2b7) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209827 +Reviewed-by: Xisco Fauli +Tested-by: Jenkins +(cherry picked from commit ecd9ee7aa1fe69399fbe0eb59d1b847e80851fd5) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209950 +Signed-off-by: Xisco Fauli +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210135 +--- + cui/source/tabpages/backgrnd.cxx | 9 ++++++--- + cui/source/tabpages/page.cxx | 15 ++++++++++----- + include/svx/unobrushitemhelper.hxx | 9 ++++++++- + svx/source/dialog/hdft.cxx | 12 ++++++++---- + svx/source/unodraw/unobrushitemhelper.cxx | 16 ++++++++++++++-- + sw/inc/doc.hxx | 4 ++++ + sw/source/core/attr/format.cxx | 5 +++-- + sw/source/core/doc/docnew.cxx | 9 +++++++++ + sw/source/core/graphic/ndgrf.cxx | 8 +------- + sw/source/core/layout/paintfrm.cxx | 12 ++---------- + sw/source/core/text/txtfld.cxx | 5 +---- + sw/source/core/unocore/unoframe.cxx | 23 +++++++++++++---------- + sw/source/core/unocore/unosett.cxx | 16 ++-------------- + sw/source/core/unocore/unostyle.cxx | 6 ++++-- + sw/source/filter/html/htmlgrin.cxx | 8 +------- + sw/source/filter/html/swhtml.cxx | 3 ++- + sw/source/filter/md/swmd.cxx | 8 +------- + sw/source/uibase/frmdlg/colex.cxx | 9 ++++++--- + sw/source/uibase/shells/basesh.cxx | 5 +++-- + 19 files changed, 98 insertions(+), 84 deletions(-) + +diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx +index 765071e0f4df..66cdbca8da23 100644 +--- a/cui/source/tabpages/backgrnd.cxx ++++ b/cui/source/tabpages/backgrnd.cxx +@@ -113,13 +113,15 @@ void SvxBkgTabPage::Reset(const SfxItemSet* pItemSet) + sal_uInt16 nWhich(pItemSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_CHAR_BACK_COLOR)); + Color aBackColor(static_cast(pItemSet->Get(nWhich)).GetValue()); + SvxBrushItem aBrushItem(SvxBrushItem(aBackColor, SID_ATTR_BRUSH_CHAR)); +- setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet, ++ getActiveDocumentLinkReferer()); + } + else + { + sal_uInt16 nWhich(pItemSet->GetPool()->GetWhichIDFromSlotID(m_bHighlighting ? SID_ATTR_BRUSH_CHAR : SID_ATTR_BRUSH)); + SvxBrushItem aBrushItem(static_cast(pItemSet->Get(nWhich))); +- setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet, ++ getActiveDocumentLinkReferer()); + } + SvxAreaTabPage::Reset(&m_aAttrSet); + } +@@ -303,7 +305,8 @@ void SvxBkgTabPage::SetActiveTableDestinationBrushItem() + if (SfxItemState::SET == GetItemSet().GetItemState(nWhich)) + { + SvxBrushItem aBrushItem(static_cast(GetItemSet().Get(nWhich))); +- setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet, ++ getActiveDocumentLinkReferer()); + } + else + { +diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx +index 868719dcd56d..b9f28ea0dd9d 100644 +--- a/cui/source/tabpages/page.cxx ++++ b/cui/source/tabpages/page.cxx +@@ -1155,7 +1155,8 @@ + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aHeaderFillAttributes = std::make_shared(aTempSet); + } + } +@@ -1191,7 +1192,8 @@ + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aFooterFillAttributes = std::make_shared(aTempSet); + } + } +@@ -1217,7 +1219,8 @@ + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem); + SfxItemSetFixed aTempSet(*rSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aPageFillAttributes = std::make_shared(aTempSet); + } + } +@@ -1281,7 +1284,8 @@ + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rHeaderSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aHeaderFillAttributes = std::make_shared(aTempSet); + } + } +@@ -1336,7 +1340,8 @@ + const SvxBrushItem& rItem = static_cast(rFooterSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rFooterSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aFooterFillAttributes = std::make_shared(aTempSet); + } + } +diff --git a/include/svx/unobrushitemhelper.hxx b/include/svx/unobrushitemhelper.hxx +index 142008764621..c391f0e38469 100644 +--- a/include/svx/unobrushitemhelper.hxx ++++ b/include/svx/unobrushitemhelper.hxx +@@ -37,9 +37,16 @@ class SfxItemSet; + // Set the equivalent in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST] in the given + // SfxItemSet to create the same FillStyle as is expressed by the given SvxBrushItem. + // This method will reset all items in the XATTR_FILL_* range first. ++// rReferer is the name of the document the brush came from, or an empty string when no ++// document named it. + SVXCORE_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet( + const SvxBrushItem& rBrush, +- SfxItemSet& rToSet); ++ SfxItemSet& rToSet, ++ OUString const& rReferer); ++ ++// The file name carried by the active document shell, or an empty string when there is no ++// active shell or the shell has no file name. ++SVXCORE_DLLPUBLIC OUString getActiveDocumentLinkReferer(); + + // Create a SvxBrushItem as close as possible to the settings in the DrawingLayer + // items in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Since this is not 100% +diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx +index 53bc257ba47b..80da65ba6637 100644 +--- a/svx/source/dialog/hdft.cxx ++++ b/svx/source/dialog/hdft.cxx +@@ -646,7 +646,8 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) + = static_cast(pBBSet->Get(nWhich)); + SfxItemSetFixed aTempSet(*pBBSet->GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aFillAttributes = + std::make_shared(aTempSet); + } +@@ -720,7 +721,8 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aHeaderFillAttributes = std::make_shared(aTempSet); + } + } +@@ -756,7 +758,8 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aFooterFillAttributes = std::make_shared(aTempSet); + } + } +@@ -782,7 +785,8 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich)); + SfxItemSetFixed aTempSet(*rSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + aPageFillAttributes = std::make_shared(aTempSet); + } + } +diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx +index ff475e8b7077..58d95a994029 100644 +--- a/svx/source/unodraw/unobrushitemhelper.cxx ++++ b/svx/source/unodraw/unobrushitemhelper.cxx +@@ -19,6 +19,9 @@ + + #include + ++#include ++#include ++ + #include + + #include +@@ -37,7 +40,16 @@ + + using namespace com::sun::star; + +-void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxItemSet& rToSet) ++OUString getActiveDocumentLinkReferer() ++{ ++ SfxObjectShell* pShell = SfxObjectShell::Current(); ++ if (pShell != nullptr && pShell->HasName()) ++ return pShell->GetMedium()->GetName(); ++ return OUString(); ++} ++ ++void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxItemSet& rToSet, ++ OUString const& rReferer) + { + // Clear all items from the DrawingLayer FillStyle range (if we have any). All + // items that need to be set will be set as hard attributes +@@ -55,7 +67,7 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI + rToSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); + + // set graphic (if available) +- const Graphic* pGraphic = rBrush.GetGraphic(); ++ const Graphic* pGraphic = rBrush.GetGraphic(rReferer); + + if(pGraphic) + { +diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx +index c581e93024dd..4e6fcf913cb4 100644 +--- a/sw/inc/doc.hxx ++++ b/sw/inc/doc.hxx +@@ -1402,6 +1402,10 @@ public: + // For Autotexts? (text modules) They have only one SVPersist at their disposal. + SW_DLLPUBLIC SfxObjectShell* GetPersist() const; + ++ /** The file name carried by the document shell, or an empty string while the shell has ++ no file name. */ ++ SW_DLLPUBLIC OUString GetLinkReferer() const; ++ + // Pointer to storage of SfxDocShells. Can be 0!!! + SW_DLLPUBLIC css::uno::Reference< css::embed::XStorage > GetDocStorage(); + +diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx +index 035cb403f6ed..8a012bcb09bb 100644 +--- a/sw/source/core/attr/format.cxx ++++ b/sw/source/core/attr/format.cxx +@@ -467,7 +467,7 @@ bool SwFormat::SetFormatAttr( const SfxPoolItem& rAttr ) + // fill a local ItemSet with the attributes corresponding as good as possible + // to the new fill properties [XATTR_FILL_FIRST .. XATTR_FILL_LAST] and set these + // as ItemSet +- setSvxBrushItemAsFillAttributesToTargetSet(rSource, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rSource, aTempSet, GetDoc()->GetLinkReferer()); + + if(IsModifyLocked()) + { +@@ -557,7 +557,8 @@ bool SwFormat::SetFormatAttr( const SfxItemSet& rSet ) + // copy all items to be set anyways to a local ItemSet with is also prepared for the new + // fill attribute ranges [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Add the attributes + // corresponding as good as possible to the new fill properties and set the whole ItemSet +- setSvxBrushItemAsFillAttributesToTargetSet(*pSource, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*pSource, aTempSet, ++ GetDoc()->GetLinkReferer()); + + if(IsModifyLocked()) + { +diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx +index e7888c10bac5..cf155263fefe 100644 +--- a/sw/source/core/doc/docnew.cxx ++++ b/sw/source/core/doc/docnew.cxx +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -667,6 +668,14 @@ SfxObjectShell* SwDoc::GetPersist() const + return mpDocShell ? mpDocShell : getIDocumentLinksAdministration().GetLinkManager().GetPersist(); + } + ++OUString SwDoc::GetLinkReferer() const ++{ ++ SfxObjectShell* pShell = GetPersist(); ++ if (pShell != nullptr && pShell->HasName()) ++ return pShell->GetMedium()->GetName(); ++ return OUString(); ++} ++ + void SwDoc::ClearDoc() + { + GetIDocumentUndoRedo().DelAllUndoObj(); +diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx +index b6794d830f7c..3d6385360182 100644 +--- a/sw/source/core/graphic/ndgrf.cxx ++++ b/sw/source/core/graphic/ndgrf.cxx +@@ -864,13 +864,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream() + + OUString sGrfNm; + sfx2::LinkManager::GetDisplayNames( mxLink.get(), nullptr, &sGrfNm ); +- OUString sReferer; +- SfxObjectShell * sh = GetDoc().GetPersist(); +- if (sh != nullptr && sh->HasName()) +- { +- sReferer = sh->GetMedium()->GetName(); +- } +- mpThreadConsumer->CreateThread( sGrfNm, sReferer ); ++ mpThreadConsumer->CreateThread( sGrfNm, GetDoc().GetLinkReferer() ); + } + + +diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx +index db529f068478..e552d4e218d8 100644 +--- a/sw/source/core/layout/paintfrm.cxx ++++ b/sw/source/core/layout/paintfrm.cxx +@@ -1813,12 +1813,7 @@ void DrawGraphic( + { + if( rSh.GetViewOptions()->IsGraphic() ) + { +- OUString referer; +- SfxObjectShell * sh = rSh.GetDoc()->GetPersist(); +- if (sh != nullptr && sh->HasName()) { +- referer = sh->GetMedium()->GetName(); +- } +- const Graphic* pGrf = pBrush->GetGraphic(referer); ++ const Graphic* pGrf = pBrush->GetGraphic(rSh.GetDoc()->GetLinkReferer()); + if( pGrf && GraphicType::NONE != pGrf->GetType() ) + { + ePos = pBrush->GetGraphicPos(); +@@ -7768,10 +7763,7 @@ Color SwPageFrame::GetDrawBackgroundColor() const + OUString referer; + SwViewShell * sh1 = getRootFrame()->GetCurrShell(); + if (sh1 != nullptr) { +- SfxObjectShell * sh2 = sh1->GetDoc()->GetPersist(); +- if (sh2 != nullptr && sh2->HasName()) { +- referer = sh2->GetMedium()->GetName(); +- } ++ referer = sh1->GetDoc()->GetLinkReferer(); + } + const Graphic* pGraphic = pBrushItem->GetGraphic(referer); + +diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx +index 4eb0934bd979..a2e6b3deedba 100644 +--- a/sw/source/core/text/txtfld.cxx ++++ b/sw/source/core/text/txtfld.cxx +@@ -544,10 +544,7 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con + OUString referer; + if (auto const sh1 = rInf.GetVsh()) { + if (auto const doc = sh1->GetDoc()) { +- auto const sh2 = doc->GetPersist(); +- if (sh2 != nullptr && sh2->HasName()) { +- referer = sh2->GetMedium()->GetName(); +- } ++ referer = doc->GetLinkReferer(); + } + } + pRet = new SwGrfNumPortion( pTextNd->GetLabelFollowedBy(), +diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx +index 99b05427ea9a..efce18608cf3 100644 +--- a/sw/source/core/unocore/unoframe.cxx ++++ b/sw/source/core/unocore/unoframe.cxx +@@ -154,7 +154,8 @@ public: + + void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal); + const uno::Any* GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId); +- bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound); ++ bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound, ++ OUString const& rReferer); + + virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) = 0; + }; +@@ -175,7 +176,8 @@ const uno::Any* BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 + return pAny; + } + +-bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound) ++bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, ++ bool& rSizeFound, OUString const& rReferer) + { + // assert when the target SfxItemSet has no parent. It *should* have the pDfltFrameFormat + // from SwDoc set as parent (or similar) to have the necessary XFILL_NONE in the ItemSet +@@ -338,7 +340,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI + bRet &= aBrush.PutValue(*pGrTransparency, MID_GRAPHIC_TRANSPARENCY); + } + +- setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet, rReferer); + } + + if(bXFillStyleItemUsed) +@@ -371,7 +373,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI + aBrush->PutValue(*pCol, MID_BACK_COLOR); + else + aBrush->PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B); +- setSvxBrushItemAsFillAttributesToTargetSet(*aBrush, rToSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aBrush, rToSet, rReferer); + } + + if(pXFillGradientItem || pXFillGradientNameItem) +@@ -481,7 +483,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI + if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID) + { + aBrush->PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY); +- setSvxBrushItemAsFillAttributesToTargetSet(*aBrush, rToSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aBrush, rToSet, rReferer); + } + } + +@@ -963,13 +963,13 @@ + { + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) ); + const ::SfxItemSet *pItemSet = &xStyle->GetItemSet(); +- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); ++ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound, pDoc->GetLinkReferer() ); + FillCol(rSet, *pItemSet); + } + else + { + const ::SfxItemSet *pItemSet = &pDoc->getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_FRAME )->GetAttrSet(); +- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); ++ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound, pDoc->GetLinkReferer() ); + FillCol(rSet, *pItemSet); + } + if (const uno::Any* pEdit = GetProperty(RES_EDIT_IN_READONLY, 0)) +@@ -1045,13 +1045,13 @@ + { + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) ); + const ::SfxItemSet *pItemSet = &xStyle->GetItemSet(); +- bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound); ++ bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound, pDoc->GetLinkReferer()); + bRet &= FillMirror(rGrSet, *pItemSet); + } + else + { + const ::SfxItemSet *pItemSet = &pDoc->getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet(); +- bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound); ++ bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound, pDoc->GetLinkReferer()); + bRet &= FillMirror(rGrSet, *pItemSet); + } + +@@ -1714,7 +1714,8 @@ + + if(*aChangedBrushItem != *aOriginalBrushItem) + { +- setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, aSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, aSet, ++ pFormat->GetDoc()->GetLinkReferer()); + pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet ); + } + +diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx +index e6296e5dc54f..a1a5295546b9 100644 +--- a/sw/source/core/unocore/unosett.cxx ++++ b/sw/source/core/unocore/unosett.cxx +@@ -1277,13 +1277,7 @@ uno::Sequence SwXNumberingRules::GetNumberingRuleByIndex( + SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl); + } + +- OUString referer; +- if (m_pDoc != nullptr) { +- auto const sh = m_pDoc->GetPersist(); +- if (sh != nullptr && sh->HasName()) { +- referer = sh->GetMedium()->GetName(); +- } +- } ++ const OUString referer = m_pDoc ? m_pDoc->GetLinkReferer() : OUString(); + return GetPropertiesForNumFormat( + rFormat, CharStyleName, m_pDocShell ? & aUString : nullptr, referer); + +@@ -1340,13 +1334,7 @@ uno::Any SwXNumberingRules::GetNumberingRuleByIndex( + SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl); + } + +- OUString referer; +- if (m_pDoc != nullptr) { +- auto const sh = m_pDoc->GetPersist(); +- if (sh != nullptr && sh->HasName()) { +- referer = sh->GetMedium()->GetName(); +- } +- } ++ const OUString referer = m_pDoc ? m_pDoc->GetLinkReferer() : OUString(); + return GetPropertyForNumFormat( + rFormat, CharStyleName, m_pDocShell ? & aUString : nullptr, referer, rPropName); + +diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx +index 41aaddc3d1ea..ceb86b674ae2 100644 +--- a/sw/source/core/unocore/unostyle.cxx ++++ b/sw/source/core/unocore/unostyle.cxx +@@ -1652,7 +1652,8 @@ void SwXStyle::SetPropertyValue(const SfxItemPropert + if(*aChangedBrushItem == *aOriginalBrushItem && (MID_GRAPHIC_TRANSPARENT != nMemberId || !aValue.has() || !aValue.get())) + return; + +- setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, rStyleSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, rStyleSet, ++ m_pDoc->GetLinkReferer()); + } + template<> + void SwXStyle::SetPropertyValue(const SfxItemPropertyMapEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +@@ -3777,7 +3778,8 @@ PropValuesToAutoStyleItemSet(SwDoc& rDoc, IStyleAccess::SwAutoStyleFamily eFamil + + if(*aChangedBrushItem != *aOriginalBrushItem) + { +- setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, aSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, aSet, ++ rDoc.GetLinkReferer()); + } + + bDone = true; +diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx +index ad89b8ec2120..2e09ccea3aea 100644 +--- a/sw/source/filter/html/htmlgrin.cxx ++++ b/sw/source/filter/html/htmlgrin.cxx +@@ -308,13 +308,7 @@ namespace + { + bool allowAccessLink(const SwDoc& rDoc) + { +- OUString sReferer; +- SfxObjectShell * sh = rDoc.GetPersist(); +- if (sh != nullptr && sh->HasName()) +- { +- sReferer = sh->GetMedium()->GetName(); +- } +- return !SvtSecurityOptions::isUntrustedReferer(sReferer); ++ return !SvtSecurityOptions::isUntrustedReferer(rDoc.GetLinkReferer()); + } + } + +diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx +index ab882bd2dab9..7728ceba49d6 100644 +--- a/sw/source/filter/html/swhtml.cxx ++++ b/sw/source/filter/html/swhtml.cxx +@@ -2983,7 +2983,8 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, + const SvxBrushItem& rBrush = static_cast< SvxBrushItem& >(*pAttr->m_pItem); + SfxItemSetFixed aNewSet(m_xDoc->GetAttrPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rBrush, aNewSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rBrush, aNewSet, ++ m_xDoc->GetLinkReferer()); + m_xDoc->getIDocumentContentOperations().InsertItemSet(aAttrPam, aNewSet, SetAttrMode::DONTREPLACE); + break; + } +diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx +index 26b08f1faf08..125779e76a3d 100644 +--- a/sw/source/uibase/frmdlg/colex.cxx ++++ b/sw/source/uibase/frmdlg/colex.cxx +@@ -121,7 +121,8 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) + const SvxBrushItem& rItem = rHeaderSet.Get(RES_BACKGROUND); + SfxItemSetFixed aTempSet(*rHeaderSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + setHeaderFillAttributes( + std::make_shared( + aTempSet)); +@@ -157,7 +158,8 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) + const SvxBrushItem& rItem = rFooterSet.Get(RES_BACKGROUND); + SfxItemSetFixed aTempSet(*rFooterSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet, ++ getActiveDocumentLinkReferer()); + setFooterFillAttributes( + std::make_shared( + aTempSet)); +@@ -172,7 +174,8 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) + // create FillAttributes from SvxBrushItem + SfxItemSetFixed aTempSet(*rSet.GetPool()); + +- setSvxBrushItemAsFillAttributesToTargetSet(*pBrushItem, aTempSet); ++ setSvxBrushItemAsFillAttributesToTargetSet(*pBrushItem, aTempSet, ++ getActiveDocumentLinkReferer()); + setPageFillAttributes( + std::make_shared( + aTempSet)); +diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx +index 48c60138e904..1dbdadf175d2 100644 +--- a/sw/source/uibase/shells/basesh.cxx ++++ b/sw/source/uibase/shells/basesh.cxx +@@ -2595,7 +2595,9 @@ + // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set + SfxItemSetFixed aCoreSet(GetPool()); + +- aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); ++ SwDoc* pDoc = GetView().GetDocShell()->GetDoc(); ++ aCoreSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet, pDoc->GetLinkReferer()); + + if(nSelType & SelectionType::Graphic || SelectionType::Frame & nSelType) + { +@@ -2727,8 +2727,9 @@ + // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set + SfxItemSetFixed aCoreSet(GetPool()); + +- aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); +- setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet); ++ SwDoc* pDoc = GetView().GetDocShell()->GetDoc(); ++ aCoreSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); ++ setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet, pDoc->GetLinkReferer()); + + if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType)) + { diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-1.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,67 @@ +From 4228f65befe5efd3c20feaf0088dc2640b0994b8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 24 Jul 2026 16:17:33 +0000 +Subject: [PATCH] ofz: emf+, return early on short read +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ia609e3586f9939db0e0a8166096f8d04c2437104 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7802 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7817 +Reviewed-by: Mike Kaganski +(cherry picked from commit 6fa74f27a0717afed4fd8b8c45442f3dbea31a7e) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8018 +--- + drawinglayer/source/tools/emfphelperdata.cxx | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx +index 1235e0d8a891..f7de52ad46e9 100644 +--- a/drawinglayer/source/tools/emfphelperdata.cxx ++++ b/drawinglayer/source/tools/emfphelperdata.cxx +@@ -1054,13 +1054,12 @@ namespace emfplushelper + // 12 is minimal valid EMF+ record size; remaining bytes are padding + while (length >= 12) + { +- sal_uInt16 type, flags; +- sal_uInt32 size, dataSize; +- sal_uInt64 next; ++ sal_uInt16 type(0), flags(0); ++ sal_uInt32 size(0), dataSize(0); + + rMS.ReadUInt16(type).ReadUInt16(flags).ReadUInt32(size).ReadUInt32(dataSize); + +- next = rMS.Tell() + (size - 12); ++ sal_uInt64 next = rMS.Tell() + (size - 12); + + if (size < 12) + { +@@ -1102,6 +1101,12 @@ namespace emfplushelper + } + if (type == EmfPlusRecordTypeObject && ((mbMultipart && (flags & 0x7fff) == (mMFlags & 0x7fff)) || (flags & 0x8000))) + { ++ if (dataSize < 4) ++ { ++ SAL_WARN("drawinglayer.emf", "DataSize field has no room for TotalObjectSize"); ++ break; ++ } ++ + if (!mbMultipart) + { + mbMultipart = true; +@@ -1109,8 +1114,6 @@ namespace emfplushelper + mMStream.Seek(0); + } + +- OSL_ENSURE(dataSize >= 4, "No room for TotalObjectSize in EmfPlusContinuedObjectRecord"); +- + // 1st 4 bytes are TotalObjectSize + mMStream.WriteBytes(static_cast(rMS.GetData()) + rMS.Tell() + 4, dataSize - 4); + SAL_INFO("drawinglayer.emf", "EMF+ read next object part size: " << size << " type: " << type << " flags: " << flags << " data size: " << dataSize); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-10.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-10.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-10.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-10.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,90 @@ +From 9cdcd23c2a7800be6ad9674f7c63525d5a637268 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 14:09:12 +0100 +Subject: [PATCH] ofz: emfio, remember where the first free object slot is +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Iadc79d94c1741167641781cdb0cc455d32385219 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7858 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/9745 +--- + emfio/inc/mtftools.hxx | 3 +++ + emfio/source/reader/mtftools.cxx | 14 +++++++++++++- + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx +index 2eeecf1f2473..a057d294ffde 100644 +--- a/emfio/inc/mtftools.hxx ++++ b/emfio/inc/mtftools.hxx +@@ -659,6 +659,9 @@ namespace emfio + RasterOp meRasterOp; + + std::vector< std::unique_ptr > mvGDIObj; ++ /// Every slot in mvGDIObj below this index holds an object, so the first free one is here ++ /// or above. ++ std::size_t mnLowestFreeGDIObj; + Point maActPos; + WMFRasterOp mnRop; + std::vector< std::shared_ptr > mvSaveStack; +diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx +index 4f38db2dd2a8..f9f7e3491e96 100644 +--- a/emfio/source/reader/mtftools.cxx ++++ b/emfio/source/reader/mtftools.cxx +@@ -952,15 +952,21 @@ namespace emfio + } + } + std::vector>::size_type nIndex; +- for ( nIndex = 0; nIndex < mvGDIObj.size(); nIndex++ ) ++ for ( nIndex = mnLowestFreeGDIObj; nIndex < mvGDIObj.size(); nIndex++ ) + { + if ( !mvGDIObj[ nIndex ] ) + break; + } ++ if ( nIndex > 0xffff ) // the same ceiling an indexed object has ++ { ++ SAL_WARN( "emfio", "too many objects" ); ++ return; ++ } + if ( nIndex == mvGDIObj.size() ) + ImplResizeObjectArry( mvGDIObj.size() + 16 ); + + mvGDIObj[ nIndex ] = std::move(pObject); ++ mnLowestFreeGDIObj = nIndex + 1; + } + + void MtfTools::CreateObjectIndexed( sal_uInt32 nIndex, std::unique_ptr pObject ) +@@ -1005,6 +1011,9 @@ namespace emfio + if ( nIndex >= mvGDIObj.size() ) + ImplResizeObjectArry( nIndex + 16 ); + ++ if ( !pObject && nIndex < mnLowestFreeGDIObj ) ++ mnLowestFreeGDIObj = nIndex; ++ + mvGDIObj[ nIndex ] = std::move(pObject); + } + +@@ -1020,6 +1029,8 @@ namespace emfio + if ( nIndex < mvGDIObj.size() ) + { + mvGDIObj[ nIndex ].reset(); ++ if ( nIndex < mnLowestFreeGDIObj ) ++ mnLowestFreeGDIObj = nIndex; + } + } + } +@@ -1090,6 +1101,7 @@ namespace emfio + mnBkMode(BackgroundMode::OPAQUE), + meLatestRasterOp(RasterOp::Invert), + meRasterOp(RasterOp::OverPaint), ++ mnLowestFreeGDIObj(0), + mnRop(), + meGfxMode(GraphicsMode::GM_COMPATIBLE), + meMapMode(MappingMode::MM_TEXT), +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-11.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-11.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-11.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-11.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,315 @@ +From 061db865e3cfed2a7fdfa580d062dcf3784ecde9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 18:59:34 +0000 +Subject: [PATCH] emf+: give the stream-read locals a starting value +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ReadUInt32 leaves the variable alone if the record ends early. + +Signed-off-by: Caolán McNamara +Change-Id: Id619384f2a266f14de73f7e49e01a160caa51245 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7868 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/9746 +--- + drawinglayer/source/tools/emfphelperdata.cxx | 74 ++++++++++---------- + 1 file changed, 37 insertions(+), 37 deletions(-) + +diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx +index a41f0e71d28d..cb93afbd0ef4 100644 +--- a/drawinglayer/source/tools/emfphelperdata.cxx ++++ b/drawinglayer/source/tools/emfphelperdata.cxx +@@ -369,7 +369,7 @@ namespace emfplushelper + + if (flags & 0x4000) + { +- sal_Int16 ix, iy; ++ sal_Int16 ix(0), iy(0); + + s.ReadInt16(ix).ReadInt16(iy); + +@@ -386,7 +386,7 @@ namespace emfplushelper + { + if (bCompressed) + { +- sal_Int16 ix, iy, iw, ih; ++ sal_Int16 ix(0), iy(0), iw(0), ih(0); + + s.ReadInt16(ix).ReadInt16(iy).ReadInt16(iw).ReadInt16(ih); + +@@ -1138,7 +1138,7 @@ namespace emfplushelper + { + case EmfPlusRecordTypeHeader: + { +- sal_uInt32 version, emfPlusFlags; ++ sal_uInt32 version(0), emfPlusFlags(0); + SAL_INFO("drawinglayer.emf", "EMF+\tDual: " << ((flags & 1) ? "true" : "false")); + + rMS.ReadUInt32(version).ReadUInt32(emfPlusFlags).ReadUInt32(mnHDPI).ReadUInt32(mnVDPI); +@@ -1195,7 +1195,7 @@ namespace emfplushelper + case EmfPlusRecordTypeDrawPie: + case EmfPlusRecordTypeDrawArc: + { +- float startAngle, sweepAngle; ++ float startAngle(0), sweepAngle(0); + + // Silent MSVC warning C4701: potentially uninitialized local variable 'brushIndexOrColor' used + sal_uInt32 brushIndexOrColor = 999; +@@ -1215,7 +1215,7 @@ namespace emfplushelper + } + + rMS.ReadFloat(startAngle).ReadFloat(sweepAngle); +- float dx, dy, dw, dh; ++ float dx(0), dy(0), dw(0), dh(0); + ReadRectangle(rMS, dx, dy, dw, dh, bool(flags & 0x4000)); + SAL_INFO("drawinglayer.emf", "EMF+\t RectData: " << dx << "," << dy << " " << dw << "x" << dh); + startAngle = basegfx::deg2rad(startAngle); +@@ -1262,7 +1262,7 @@ namespace emfplushelper + case EmfPlusRecordTypeFillPath: + { + sal_uInt32 index = flags & 0xff; +- sal_uInt32 brushIndexOrColor; ++ sal_uInt32 brushIndexOrColor(0); + rMS.ReadUInt32(brushIndexOrColor); + SAL_INFO("drawinglayer.emf", "EMF+ FillPath slot: " << index); + +@@ -1276,7 +1276,7 @@ namespace emfplushelper + case EmfPlusRecordTypeFillRegion: + { + sal_uInt32 index = flags & 0xff; +- sal_uInt32 brushIndexOrColor; ++ sal_uInt32 brushIndexOrColor(0); + rMS.ReadUInt32(brushIndexOrColor); + SAL_INFO("drawinglayer.emf", "EMF+\t FillRegion slot: " << index); + +@@ -1301,7 +1301,7 @@ namespace emfplushelper + } + + SAL_INFO("drawinglayer.emf", "EMF+\t " << (type == EmfPlusRecordTypeFillEllipse ? "Fill" : "Draw") << "Ellipse slot: " << (flags & 0xff)); +- float dx, dy, dw, dh; ++ float dx(0), dy(0), dw(0), dh(0); + ReadRectangle(rMS, dx, dy, dw, dh, bool(flags & 0x4000)); + SAL_INFO("drawinglayer.emf", "EMF+\t RectData: " << dx << "," << dy << " " << dw << "x" << dh); + ::basegfx::B2DPolyPolygon polyPolygon( +@@ -1320,8 +1320,8 @@ namespace emfplushelper + // Silent MSVC warning C4701: potentially uninitialized local variable 'brushIndexOrColor' used + sal_uInt32 brushIndexOrColor = 999; + ::basegfx::B2DPolyPolygon polyPolygon; +- sal_uInt32 rectangles; +- float x, y, width, height; ++ sal_uInt32 rectangles(0); ++ float x(0), y(0), width(0), height(0); + const bool isColor = (flags & 0x8000); + ::basegfx::B2DPolygon polygon; + +@@ -1358,7 +1358,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeFillPolygon: + { +- sal_uInt32 brushIndexOrColor, points; ++ sal_uInt32 brushIndexOrColor(0), points(0); + + rMS.ReadUInt32(brushIndexOrColor); + rMS.ReadUInt32(points); +@@ -1373,7 +1373,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeDrawLines: + { +- sal_uInt32 points; ++ sal_uInt32 points(0); + rMS.ReadUInt32(points); + SAL_INFO("drawinglayer.emf", "EMF+\t Points: " << points); + EMFPPath path(points, true); +@@ -1387,7 +1387,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeDrawPath: + { +- sal_uInt32 penIndex; ++ sal_uInt32 penIndex(0); + rMS.ReadUInt32(penIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t Pen: " << penIndex); + +@@ -1401,8 +1401,8 @@ namespace emfplushelper + } + case EmfPlusRecordTypeDrawBeziers: + { +- sal_uInt32 aCount; +- float x1, y1, x2, y2, x3, y3, x4, y4; ++ sal_uInt32 aCount(0); ++ float x1(0), y1(0), x2(0), y2(0), x3(0), y3(0), x4(0), y4(0); + ::basegfx::B2DPolygon aPolygon; + rMS.ReadUInt32(aCount); + SAL_INFO("drawinglayer.emf", "EMF+\t DrawBeziers slot: " << (flags & 0xff)); +@@ -1440,8 +1440,8 @@ namespace emfplushelper + } + case EmfPlusRecordTypeDrawCurve: + { +- sal_uInt32 aOffset, aNumSegments, points; +- float aTension; ++ sal_uInt32 aOffset(0), aNumSegments(0), points(0); ++ float aTension(0); + rMS.ReadFloat(aTension); + rMS.ReadUInt32(aOffset); + rMS.ReadUInt32(aNumSegments); +@@ -1467,7 +1467,7 @@ namespace emfplushelper + { + // Silent MSVC warning C4701: potentially uninitialized local variable 'brushIndexOrColor' used + sal_uInt32 brushIndexOrColor = 999, points; +- float aTension; ++ float aTension(0); + if (type == EmfPlusRecordTypeFillClosedCurve) + { + rMS.ReadUInt32(brushIndexOrColor); +@@ -1500,8 +1500,8 @@ namespace emfplushelper + case EmfPlusRecordTypeDrawImage: + case EmfPlusRecordTypeDrawImagePoints: + { +- sal_uInt32 imageAttributesId; +- sal_Int32 sourceUnit; ++ sal_uInt32 imageAttributesId(0); ++ sal_Int32 sourceUnit(0); + rMS.ReadUInt32(imageAttributesId).ReadInt32(sourceUnit); + SAL_INFO("drawinglayer.emf", + "EMF+\t " << (type == EmfPlusRecordTypeDrawImage ? "DrawImage" +@@ -1515,7 +1515,7 @@ namespace emfplushelper + dynamic_cast(maEMFPObjects[flags & 0xff].get()) : + nullptr) + { +- float sx, sy, sw, sh; ++ float sx(0), sy(0), sw(0), sh(0); + ReadRectangle(rMS, sx, sy, sw, sh); + + ::tools::Rectangle aSource(Point(sx, sy), Size(sw + 1, sh + 1)); +@@ -1531,7 +1531,7 @@ namespace emfplushelper + double fShearY = 0.0; + if (type == EmfPlusRecordTypeDrawImagePoints) + { +- sal_uInt32 aCount; ++ sal_uInt32 aCount(0); + rMS.ReadUInt32(aCount); + + // Number of points used by DrawImagePoints. Exactly 3 points must be specified. +@@ -1542,7 +1542,7 @@ namespace emfplushelper + << aCount); + break; + } +- float x1, y1, x2, y2, x3, y3; ++ float x1(0), y1(0), x2(0), y2(0), x3(0), y3(0); + + ReadPoint(rMS, x1, y1, flags); // upper-left point + ReadPoint(rMS, x2, y2, flags); // upper-right +@@ -1670,7 +1670,7 @@ namespace emfplushelper + SAL_INFO("drawinglayer.emf", "EMF+\t Length: " << stringLength); + + // read the layout rectangle +- float lx, ly, lw, lh; ++ float lx(0), ly(0), lw(0), lh(0); + rMS.ReadFloat(lx).ReadFloat(ly).ReadFloat(lw).ReadFloat(lh); + + SAL_INFO("drawinglayer.emf", "EMF+\t DrawString layoutRect: " << lx << "," << ly << " - " << lw << "x" << lh); +@@ -1891,7 +1891,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeSave: + { +- sal_uInt32 stackIndex; ++ sal_uInt32 stackIndex(0); + rMS.ReadUInt32(stackIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t Save stack index: " << stackIndex); + +@@ -1901,7 +1901,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeRestore: + { +- sal_uInt32 stackIndex; ++ sal_uInt32 stackIndex(0); + rMS.ReadUInt32(stackIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t Restore stack index: " << stackIndex); + +@@ -1910,15 +1910,15 @@ namespace emfplushelper + } + case EmfPlusRecordTypeBeginContainer: + { +- float dx, dy, dw, dh; ++ float dx(0), dy(0), dw(0), dh(0); + ReadRectangle(rMS, dx, dy, dw, dh); + SAL_INFO("drawinglayer.emf", "EMF+\t Dest RectData: " << dx << "," << dy << " " << dw << "x" << dh); + +- float sx, sy, sw, sh; ++ float sx(0), sy(0), sw(0), sh(0); + ReadRectangle(rMS, sx, sy, sw, sh); + SAL_INFO("drawinglayer.emf", "EMF+\t Source RectData: " << sx << "," << sy << " " << sw << "x" << sh); + +- sal_uInt32 stackIndex; ++ sal_uInt32 stackIndex(0); + rMS.ReadUInt32(stackIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t Begin Container stack index: " << stackIndex << ", PageUnit: " << flags); + +@@ -1934,7 +1934,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeBeginContainerNoParams: + { +- sal_uInt32 stackIndex; ++ sal_uInt32 stackIndex(0); + rMS.ReadUInt32(stackIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t Begin Container No Params stack index: " << stackIndex); + +@@ -1943,7 +1943,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeEndContainer: + { +- sal_uInt32 stackIndex; ++ sal_uInt32 stackIndex(0); + rMS.ReadUInt32(stackIndex); + SAL_INFO("drawinglayer.emf", "EMF+\t End Container stack index: " << stackIndex); + +@@ -1997,7 +1997,7 @@ namespace emfplushelper + SAL_INFO("drawinglayer.emf", "EMF+\t TranslateWorldTransform, Post multiply: " << bool(flags & 0x2000)); + + basegfx::B2DHomMatrix transform; +- float eDx, eDy; ++ float eDx(0), eDy(0); + rMS.ReadFloat(eDx).ReadFloat(eDy); + transform.set(0, 2, eDx); + transform.set(1, 2, eDy); +@@ -2026,7 +2026,7 @@ namespace emfplushelper + case EmfPlusRecordTypeScaleWorldTransform: + { + basegfx::B2DHomMatrix transform; +- float eSx, eSy; ++ float eSx(0), eSy(0); + rMS.ReadFloat(eSx).ReadFloat(eSy); + transform.set(0, 0, eSx); + transform.set(1, 1, eSy); +@@ -2057,7 +2057,7 @@ namespace emfplushelper + case EmfPlusRecordTypeRotateWorldTransform: + { + // Angle of rotation in degrees +- float eAngle; ++ float eAngle(0); + rMS.ReadFloat(eAngle); + + SAL_INFO("drawinglayer.emf", "EMF+\t RotateWorldTransform Angle: " << eAngle << +@@ -2091,7 +2091,7 @@ namespace emfplushelper + { + SAL_INFO("drawinglayer.emf", "EMF+\t SetClipRect"); + +- float dx, dy, dw, dh; ++ float dx(0), dy(0), dw(0), dh(0); + ReadRectangle(rMS, dx, dy, dw, dh); + SAL_INFO("drawinglayer.emf", + "EMF+\t RectData: " << dx << "," << dy << " " << dw << "x" << dh); +@@ -2175,7 +2175,7 @@ namespace emfplushelper + } + case EmfPlusRecordTypeOffsetClip: + { +- float dx, dy; ++ float dx(0), dy(0); + rMS.ReadFloat(dx).ReadFloat(dy); + SAL_INFO("drawinglayer.emf", "EMF+\tOffset x:" << dx << ", y:" << dy); + +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-2.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,32 @@ +From e5151173e1119f04bd4a87d546d0c69a963e92ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 25 Jul 2026 12:33:44 +0100 +Subject: [PATCH] ofz: emf+, check if enough data is available +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I91eab7d3067d9d151c420fb77054f12ed3d014c7 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7821 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7928 +--- + drawinglayer/source/tools/emfpimage.cxx | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drawinglayer/source/tools/emfpimage.cxx b/drawinglayer/source/tools/emfpimage.cxx +index 0425a80d5c4f..9a7f711b4836 100644 +--- a/drawinglayer/source/tools/emfpimage.cxx ++++ b/drawinglayer/source/tools/emfpimage.cxx +@@ -53,6 +53,9 @@ namespace emfplushelper + else + dataSize -= 16; + ++ if (dataSize > s.remainingSize()) ++ dataSize = s.remainingSize(); ++ + SAL_INFO("drawinglayer.emf", "EMF+\tmetafile type: " << mfType << " dataSize: " << mfSize << " real size calculated from record dataSize: " << dataSize); + + GraphicFilter filter; diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-3.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,48 @@ +From a346615f999693914031b5e839d3fb25704d55a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 25 Jul 2026 15:07:54 +0100 +Subject: [PATCH] ofz: emf+, null deref +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ibd0bce6bf34a1a8cb3d992b6abb2a9266c944e3f +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7830 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7852 +Reviewed-by: Mike Kaganski +(cherry picked from commit 7c603236253501c5ceceece3c6b4dd5b1e580b5d) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8026 +--- + drawinglayer/source/tools/emfphelperdata.cxx | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx +index f7de52ad46e9..a41f0e71d28d 100644 +--- a/drawinglayer/source/tools/emfphelperdata.cxx ++++ b/drawinglayer/source/tools/emfphelperdata.cxx +@@ -608,7 +608,8 @@ namespace emfplushelper + drawinglayer::attribute::LineStartEndAttribute aStart; + if (pen->penDataFlags & EmfPlusPenDataStartCap) + { +- if ((pen->penDataFlags & EmfPlusPenDataCustomStartCap) ++ if ((pen->penDataFlags & EmfPlusPenDataCustomStartCap) && pen->customStartCap ++ && pen->customStartCap->polygon.count() + && (pen->customStartCap->polygon.begin()->count() > 1)) + aStart = drawinglayer::attribute::LineStartEndAttribute( + pen->customStartCap->polygon.getB2DRange().getRange().getX() * mdExtractedXScale +@@ -621,7 +622,8 @@ namespace emfplushelper + drawinglayer::attribute::LineStartEndAttribute aEnd; + if (pen->penDataFlags & EmfPlusPenDataEndCap) + { +- if ((pen->penDataFlags & EmfPlusPenDataCustomEndCap) ++ if ((pen->penDataFlags & EmfPlusPenDataCustomEndCap) && pen->customEndCap ++ && pen->customEndCap->polygon.count() + && (pen->customEndCap->polygon.begin()->count() > 1)) + aEnd = drawinglayer::attribute::LineStartEndAttribute( + pen->customEndCap->polygon.getB2DRange().getRange().getX() * mdExtractedXScale +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-4.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-4.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-4.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-4.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,93 @@ +From 4258294f4ae48a6f90b4efafb333b42525de7f98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 25 Jul 2026 18:27:08 +0100 +Subject: [PATCH] ofz: drawing, don't allow pops past starting depth +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +since: + +commit bf8660708144ccb693063a20954f64a66a1c979d +Date: Fri Jun 4 14:34:23 2010 +0200 + + #i112117# changed the Metafile primitive decomposition to better handle sub-metafile contents + +which moved the pop out of the flags check that paired it with the push, so an +empty PUSH, or more POPs than PUSHes, drains the stack and Current() hands +back its fallback static + +Signed-off-by: Caolán McNamara +Change-Id: Ide76ca082d0bdbdf391ab72da23d87e8d85c7348 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7839 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7845 +Reviewed-by: Mike Kaganski +(cherry picked from commit 9f1bf5b844295a532cc9e93f84acb44ed345294c) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8164 +--- + drawinglayer/source/tools/wmfemfhelper.cxx | 34 +++++++++++++--------- + 1 file changed, 21 insertions(+), 13 deletions(-) + +diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx +index ea6ac967af87..966f5d7c54c7 100644 +--- a/drawinglayer/source/tools/wmfemfhelper.cxx ++++ b/drawinglayer/source/tools/wmfemfhelper.cxx +@@ -17,6 +17,8 @@ + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + ++#include ++ + #include + #include + #include +@@ -151,25 +153,31 @@ namespace wmfemfhelper + + void PropertyHolders::Push(vcl::PushFlags nPushFlags) + { +- if (bool(nPushFlags)) +- { +- OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)"); +- if (!maPropertyHolders.empty()) +- { +- PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back()); +- pNew->setPushFlags(nPushFlags); +- maPropertyHolders.push_back(pNew); +- } +- } ++ // The holder the stack is constructed with is never popped, so there is always one to copy. ++ assert(!maPropertyHolders.empty()); ++ ++ // Every push adds a holder, including one with no flags at all, so each pop has exactly one ++ // push to pair with. A holder with no flags copies nothing back when it is popped. ++ PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back()); ++ pNew->setPushFlags(nPushFlags); ++ maPropertyHolders.push_back(pNew); + } + + void PropertyHolders::Pop() + { +- OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: POP with no property holders (!)"); +- const sal_uInt32 nSize(maPropertyHolders.size()); ++ assert(!maPropertyHolders.empty()); ++ ++ // Only a holder that a push added can be popped, so a metafile with more pops than pushes ++ // keeps the holder the stack was constructed with. ++ const size_t nPushCount(maPropertyHolders.size() - 1); + +- if (!nSize) ++ if (!nPushCount) ++ { ++ SAL_WARN("drawinglayer", "PropertyHolders: POP without a matching PUSH (!)"); + return; ++ } ++ ++ const sal_uInt32 nSize(maPropertyHolders.size()); + + const PropertyHolder* pTip = maPropertyHolders.back(); + const vcl::PushFlags nPushFlags(pTip->getPushFlags()); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-5.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-5.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-5.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-5.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,34 @@ +From d727a69c44ba4ed25673ffdcd1a532ea4c0dedcb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 25 Jul 2026 15:15:07 +0100 +Subject: [PATCH] ofz: drawing, check if offset is correct +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I5567d1cced44649487d7feb687651dae710b2641 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7832 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7853 +Reviewed-by: Mike Kaganski +(cherry picked from commit 67848b0ef12d7817719afa5eb597bc2c0a316f80) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8064 +--- + drawinglayer/source/tools/emfppath.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drawinglayer/source/tools/emfppath.cxx b/drawinglayer/source/tools/emfppath.cxx +index 29b9ac8a0232..aac972e3612e 100644 +--- a/drawinglayer/source/tools/emfppath.cxx ++++ b/drawinglayer/source/tools/emfppath.cxx +@@ -262,6 +262,8 @@ namespace emfplushelper + double x, y; + if (aNumSegments >= nPoints) + aNumSegments = nPoints - 1; ++ if (aOffset >= aNumSegments) ++ return aPolygon; + GetCardinalMatrix(fTension, mat); + // duplicate first point + xPoints.push_front(xPoints.front()); diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-6.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-6.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-6.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-6.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,93 @@ +From 4f5361625c1132d6f18b8464c0e69f3cd3e19ea8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 11:56:38 +0100 +Subject: [PATCH] ofz: drawing, better calculation for how many points could be + in the stream +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I1ca0dee6ce15e3d3f62583fbc21791d014c42da0 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7847 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7849 +Reviewed-by: Mike Kaganski +(cherry picked from commit d75f91c68970a4ef1397c881ab9f37002fe1e462) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8117 +--- + drawinglayer/source/tools/emfppath.cxx | 35 +++++++++++++++++++------- + drawinglayer/source/tools/emfppath.hxx | 2 ++ + 2 files changed, 28 insertions(+), 9 deletions(-) + +diff --git a/drawinglayer/source/tools/emfppath.cxx b/drawinglayer/source/tools/emfppath.cxx +index aac972e3612e..dadc946fa852 100644 +--- a/drawinglayer/source/tools/emfppath.cxx ++++ b/drawinglayer/source/tools/emfppath.cxx +@@ -65,16 +65,9 @@ namespace emfplushelper + } + + EMFPPath::EMFPPath (sal_uInt32 _nPoints, bool bLines) ++ : nPoints(_nPoints) ++ , bHasPointTypes(!bLines) + { +- if (_nPoints > SAL_MAX_UINT32 / (2 * sizeof(float))) +- { +- _nPoints = SAL_MAX_UINT32 / (2 * sizeof(float)); +- } +- +- nPoints = _nPoints; +- +- if (!bLines) +- pPointTypes.reset( new sal_uInt8 [_nPoints] ); + } + + EMFPPath::~EMFPPath () +@@ -83,6 +76,30 @@ namespace emfplushelper + + void EMFPPath::Read (SvStream& s, sal_uInt32 pathFlags) + { ++ // A point requires at least this many bytes in the stream, so the ++ // stream that is left says how many points there can really be, ++ // whatever count the file gave. ++ sal_uInt32 nBytesPerPoint; ++ if (pathFlags & 0x800) ++ nBytesPerPoint = 2; // EmfPlusPointR, one byte for each of the two coordinates ++ else if (pathFlags & 0x4000) ++ nBytesPerPoint = 4; // EmfPlusPoint ++ else ++ nBytesPerPoint = 8; // EmfPlusPointF ++ if (bHasPointTypes) ++ nBytesPerPoint += 1; ++ ++ const sal_uInt64 nMaxPoints = s.remainingSize() / nBytesPerPoint; ++ if (nPoints > nMaxPoints) ++ { ++ SAL_WARN("drawinglayer.emf", "EMF+\tpath wants " << nPoints ++ << " points, the stream holds " << nMaxPoints); ++ nPoints = nMaxPoints; ++ } ++ ++ if (bHasPointTypes) ++ pPointTypes.reset( new sal_uInt8 [nPoints] ); ++ + float fx, fy; + for (sal_uInt32 i = 0; i < nPoints; i++) + { +diff --git a/drawinglayer/source/tools/emfppath.hxx b/drawinglayer/source/tools/emfppath.hxx +index e6104fcb1fc7..17eeb10b7227 100644 +--- a/drawinglayer/source/tools/emfppath.hxx ++++ b/drawinglayer/source/tools/emfppath.hxx +@@ -29,6 +29,8 @@ namespace emfplushelper + sal_uInt32 nPoints; + std::deque xPoints, yPoints; + std::unique_ptr pPointTypes; ++ /// true when a point type byte follows each point in the stream ++ bool bHasPointTypes; + + public: + EMFPPath(sal_uInt32 _nPoints, bool bLines = false); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-7.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-7.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-7.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-7.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,47 @@ +From 0e11120da026835944d16dfd4547459061e9ad6e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 12:06:14 +0100 +Subject: [PATCH] ofz: emfio, return early for bogus Polygon nextpos +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I5c91676d924cd1e92baa359464c4147509a59832 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7848 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7857 +Reviewed-by: Mike Kaganski +(cherry picked from commit 77127124cf8910574abf16ee7079c140086fc995) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8112 +--- + emfio/source/reader/emfreader.cxx | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx +index d6f5a32885c9..0378ddd1b4d2 100644 +--- a/emfio/source/reader/emfreader.cxx ++++ b/emfio/source/reader/emfreader.cxx +@@ -670,7 +670,17 @@ namespace emfio + if (!bRecordOk || !nPoints) + return tools::Polygon(); + +- auto nRemainingSize = std::min(nNextPos - mpInputStream->Tell(), mpInputStream->remainingSize()); ++ // The header fields are read before this point, so a record that is shorter than those ++ // fields leaves the stream past the end of its own data and holds no points at all. ++ const sal_uInt64 nEndPos = std::min(nNextPos, mnEndPos); ++ if (mpInputStream->Tell() >= nEndPos) ++ { ++ SAL_WARN("emfio", "polygon record ends before its points begin"); ++ return tools::Polygon(); ++ } ++ ++ const sal_uInt64 nRemainingSize ++ = std::min(nEndPos - mpInputStream->Tell(), mpInputStream->remainingSize()); + auto nMaxPossiblePoints = nRemainingSize / (sizeof(T) * 2); + auto nPointCount = nPoints - nStartIndex; + if (nPointCount > nMaxPossiblePoints) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-8.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-8.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-8.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-8.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,43 @@ +From 86bb9d161c5d1c179804110b8c42fb5bcf00d7bd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 19:19:47 +0000 +Subject: [PATCH] wmf: initialize each palette entry and stop reading on stream + failure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: I2f2449be83cd7d895726e2200cae15d276a0eccf +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7869 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7870 +Reviewed-by: Mike Kaganski +(cherry picked from commit 9d70e966bc709bd10f96f9ca699778b937c6dcdf) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/8114 +--- + emfio/source/reader/wmfreader.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx +index e490f67d036c..9a71a57d4c4f 100644 +--- a/emfio/source/reader/wmfreader.cxx ++++ b/emfio/source/reader/wmfreader.cxx +@@ -1044,11 +1044,11 @@ namespace emfio + if (nRecordSize != 2u * nNumberOfEntries + 5u) + bRecordOk = false; + SAL_INFO("emfio", "\t\t Start 0x" << std::hex << nStart << std::dec << ", Number of entries: " << nNumberOfEntries); +- sal_uInt32 nPalleteEntry; + std::vector< Color > aPaletteColors; +- for (sal_uInt16 i = 0; i < nNumberOfEntries; ++i) ++ for (sal_uInt16 i = 0; i < nNumberOfEntries && mpInputStream->good(); ++i) + { + //PALETTEENTRY: Values, Blue, Green, Red ++ sal_uInt32 nPalleteEntry(0); + mpInputStream->ReadUInt32( nPalleteEntry ); + SAL_INFO("emfio", "\t\t " << i << ". Palette entry: " << std::setw(10) << std::showbase <(nPalleteEntry), static_cast(nPalleteEntry >> 8), static_cast(nPalleteEntry >> 16)); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-18566-9.diff libreoffice-25.2.3/debian/patches/CVE-2026-18566-9.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-18566-9.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-18566-9.diff 2026-11-13 23:25:48.000000000 +0000 @@ -0,0 +1,109 @@ +From 93a3d4d3ed89bca0784178d5e1bec2793a23c504 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sun, 26 Jul 2026 12:44:26 +0100 +Subject: [PATCH] ofz: emfio, return early for bogus comment counts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ib745f2126b090135db4739925c21b9335bd91ab3 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7850 +Reviewed-by: Noel Grandin +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/9744 +--- + emfio/inc/emfreader.hxx | 4 ++-- + emfio/source/reader/emfreader.cxx | 23 +++++++++++++++++------ + 2 files changed, 19 insertions(+), 8 deletions(-) + +diff --git a/emfio/inc/emfreader.hxx b/emfio/inc/emfreader.hxx +index 4893a45733af..65d2e888f7d3 100644 +--- a/emfio/inc/emfreader.hxx ++++ b/emfio/inc/emfreader.hxx +@@ -44,9 +44,9 @@ namespace emfio + ~EmfReader(); + + bool ReadEnhWMF(); +- void ReadGDIComment(sal_uInt32 nCommentId); ++ void ReadGDIComment(sal_uInt32 nCommentId, sal_uInt64 nNextPos); + /// Parses EMR_COMMENT_MULTIFORMATS. +- void ReadMultiformatsComment(); ++ void ReadMultiformatsComment(sal_uInt64 nNextPos); + void SetSizeHint(const basegfx::B2DTuple& rSizeHint) { maSizeHint = rSizeHint; } + void SetEnableEMFPlus(bool bEnableEMFPlus) { mbEnableEMFPlus = bEnableEMFPlus; } + +diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx +index e14984f6867c..294bdf7b3bf3 100644 +--- a/emfio/source/reader/emfreader.cxx ++++ b/emfio/source/reader/emfreader.cxx +@@ -420,7 +420,7 @@ namespace emfio + const sal_uInt32 EMR_COMMENT_MULTIFORMATS = 0x40000004; + const sal_uInt32 EMR_COMMENT_WINDOWS_METAFILE = 0x80000001; + +- void EmfReader::ReadGDIComment(sal_uInt32 nCommentId) ++ void EmfReader::ReadGDIComment(sal_uInt32 nCommentId, sal_uInt64 nNextPos) + { + sal_uInt32 nPublicCommentIdentifier(0); + mpInputStream->ReadUInt32(nPublicCommentIdentifier); +@@ -457,7 +457,7 @@ namespace emfio + break; + + case EMR_COMMENT_MULTIFORMATS: +- ReadMultiformatsComment(); ++ ReadMultiformatsComment(nNextPos); + break; + + case EMR_COMMENT_WINDOWS_METAFILE: +@@ -470,7 +470,7 @@ namespace emfio + } + } + +- void EmfReader::ReadMultiformatsComment() ++ void EmfReader::ReadMultiformatsComment(sal_uInt64 nNextPos) + { + tools::Rectangle aOutputRect = EmfReader::ReadRectangle(); + +@@ -496,9 +496,17 @@ namespace emfio + return; + } + ++ // The embedded data lives inside this comment record, so the record says how much of it ++ // there can be. ++ const sal_uInt64 nRecordEnd = std::min(nNextPos, mnEndPos); ++ const sal_uInt64 nDataLeft = mpInputStream->Tell() < nRecordEnd ++ ? std::min(nRecordEnd - mpInputStream->Tell(), ++ mpInputStream->remainingSize()) ++ : 0; ++ + sal_uInt32 nSizeData(0); + mpInputStream->ReadUInt32(nSizeData); +- if (!nSizeData || nSizeData > mpInputStream->remainingSize()) ++ if (!nSizeData || nSizeData > nDataLeft) + { + return; + } +@@ -902,7 +910,10 @@ namespace emfio + + SAL_INFO("emfio", "\tGDI comment, length: " << length); + +- if( mpInputStream->good() && length >= 4 && length <= mpInputStream->remainingSize() ) { ++ // DataSize counts the bytes that follow it inside this record, so the record size ++ // minus its own 8 byte header and the 4 byte DataSize field is the most it can be. ++ if( mpInputStream->good() && length >= 4 && nRecSize >= 12 ++ && length <= nRecSize - 12 && length <= mpInputStream->remainingSize() ) { + sal_uInt32 nCommentId; + + mpInputStream->ReadUInt32( nCommentId ); +@@ -917,7 +928,7 @@ namespace emfio + } + else if( nCommentId == EMR_COMMENT_PUBLIC && nRecSize >= 12 ) + { +- ReadGDIComment(nCommentId); ++ ReadGDIComment(nCommentId, nNextPos); + } + else if( nCommentId == EMR_COMMENT_EMFSPOOL && nRecSize >= 12 ) + { +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-63267-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-63267-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-63267-1.diff 2026-10-03 14:08:35.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-63267-1.diff 2026-11-15 16:22:00.000000000 +0000 @@ -275,6 +275,7 @@ rBtn.set_label(ScResId(STR_ENABLE_CONTENT)); rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP)); rBtn.connect_clicked(LINK(this, ScDocShell, ReloadAllLinksHdl)); +# FIXME: Not sure about thhe second hunk diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 4babed2103ed..27e8631a8678 100644 --- a/sc/source/ui/docshell/tablink.cxx @@ -287,16 +288,16 @@ #include #include -#@@ -139,6 +140,9 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter, -# if (rNewFile.isEmpty() || rNewFilter.isEmpty()) -# return false; -# -#+ if (!m_rDocSh.GetEmbeddedObjectContainer().getUserAllowsLinkUpdate()) -#+ return false; -#+ -# OUString aNewUrl = ScGlobal::GetAbsDocName(rNewFile, &m_rDocSh); -# bool bNewUrlName = aFileName != aNewUrl; -# +@@ -148,6 +148,9 @@ + if (rNewFile.isEmpty() || rNewFilter.isEmpty()) + return false; + ++ if (!pImpl->m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate()) ++ return false; ++ + OUString aNewUrl = ScGlobal::GetAbsDocName(rNewFile, pImpl->m_pDocSh); + bool bNewUrlName = aFileName != aNewUrl; + diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 8e2551a9f02d..164f3dfd8b55 100644 --- a/sc/source/ui/view/tabvwsh4.cxx diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-84234.diff libreoffice-25.2.3/debian/patches/CVE-2026-84234.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-84234.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-84234.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,147 @@ +From a463e295ab095ece7939997482f6d38cb8ca6a5a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2026 12:20:50 +0000 +Subject: [PATCH] pdf import: check the sizes before building the png scan + lines +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +dismiss unreasonable sizes and ImageStream::getLine returns null when it +could not allocate its line buffer. + +Change-Id: I193038c0ff8e2f0ed68235569fc72ff7028db2c2 +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/10751 +Tested-by: Jenkins CPCI +Reviewed-by: Miklos Vajna +--- + .../pdfimport/xpdfwrapper/pnghelper.cxx | 53 ++++++++++++++++--- + 1 file changed, 47 insertions(+), 6 deletions(-) + +diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx +index 6e9784d4aa6b..e77a6d78f863 100644 +--- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx ++++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx +@@ -18,12 +18,36 @@ + */ + + #include "pnghelper.hxx" ++#include + #include + + #include + + using namespace pdfi; + ++namespace ++{ ++ const sal_Int32 nMaxPixelsAllowed = SAL_MAX_INT32/2/4; ++ ++ bool isReasonableSize( int width, int height ) ++ { ++ sal_Int32 nPixels; ++ if( width < 1 || height < 1 ) ++ return false; ++ return !o3tl::checked_multiply( sal_Int32( width ), sal_Int32( height ), nPixels ) ++ && nPixels <= nMaxPixelsAllowed; ++ } ++ ++ sal_Int64 alphaOffsetForMaskPixel( int y, int x, ++ int width, int height, ++ int maskWidth, int maskHeight ) ++ { ++ const sal_Int64 nLine = sal_Int64( y ) * height / maskHeight; ++ const sal_Int64 nColumn = sal_Int64( x ) * width / maskWidth; ++ return nLine * ( sal_Int64( width ) * 4 + 1 ) + nColumn * 4 + 4; ++ } ++} ++ + // checksum helpers, courtesy of libpng.org + + /* Table of CRCs of all 8-bit messages. */ +@@ -184,6 +208,9 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + bool bIsMask + ) + { ++ if( !isReasonableSize( width, height ) ) ++ return; ++ + appendFileHeader( o_rOutputBuf ); + appendIHDR( o_rOutputBuf, width, height, 1, 3 ); + +@@ -248,6 +275,9 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + Stream* maskStr, + int maskWidth, int maskHeight, GfxImageColorMap* maskColorMap ) + { ++ if( !isReasonableSize( width, height ) ) ++ return; ++ + appendFileHeader( o_rOutputBuf ); + appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image + +@@ -278,6 +308,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + { + aScanlines.push_back( 0 ); + p = imgStr->getLine(); ++ if( !p ) ++ return; + for( int x=0; xgetRGB(p, &rgb); +@@ -318,13 +350,16 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + for( int y = 0; y < maskHeight; ++y ) + { + pm = imgStrMask->getLine(); ++ if( !pm ) ++ break; + for( int x = 0; x < maskWidth; ++x ) + { + maskColorMap->getGray(pm,&alpha); + pm += maskColorMap->getNumPixelComps(); +- int nIndex = (y*height/maskHeight) * (width*4+1) + // mapped line +- (x*width/maskWidth)*4 + 1 + 3 // mapped column +- ; ++ const sal_Int64 nIndex = alphaOffsetForMaskPixel( y, x, width, height, ++ maskWidth, maskHeight ); ++ if( nIndex < 0 || o3tl::make_unsigned( nIndex ) >= aScanlines.size() ) ++ continue; + aScanlines[ nIndex ] = colToByte(alpha); + } + } +@@ -351,6 +386,9 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + bool maskInvert + ) + { ++ if( !isReasonableSize( width, height ) ) ++ return; ++ + appendFileHeader( o_rOutputBuf ); + appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image + +@@ -380,6 +418,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + { + aScanlines.push_back( 0 ); + p = imgStr->getLine(); ++ if( !p ) ++ return; + for( int x=0; xgetRGB(p, &rgb); +@@ -420,9 +460,10 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, + { + unsigned char aPixel = 0; + imgStrMask->getPixel( &aPixel ); +- int nIndex = (y*height/maskHeight) * (width*4+1) + // mapped line +- (x*width/maskWidth)*4 + 1 + 3 // mapped column +- ; ++ const sal_Int64 nIndex = alphaOffsetForMaskPixel( y, x, width, height, ++ maskWidth, maskHeight ); ++ if( nIndex < 0 || o3tl::make_unsigned( nIndex ) >= aScanlines.size() ) ++ continue; + if( maskInvert ) + aScanlines[ nIndex ] = aPixel ? 0xff : 0x00; + else +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-84443-1.diff libreoffice-25.2.3/debian/patches/CVE-2026-84443-1.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-84443-1.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-84443-1.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,156 @@ +From a43b7a8690d0719e04b688a860eeeb155446093b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2026 14:35:11 +0000 +Subject: [PATCH] move isScriptURLAllowed onto SfxObjectShell +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +it was private to sfx2's eventsupplier.hxx, so nothing outside sfx2 +could run the AllowedDocumentEventURLs test + +Change-Id: I814a965cafc245eb7b7f2d8fb18a81d1f7b7e50f +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/10779 +Tested-by: Jenkins CPCI +--- + include/sfx2/objsh.hxx | 3 +++ + sfx2/source/doc/objmisc.cxx | 29 +++++++++++++++++++++++++++ + sfx2/source/inc/eventsupplier.hxx | 4 ---- + sfx2/source/notify/eventsupplier.cxx | 30 +--------------------------- + 4 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx +index 9df501fcb7ce..bfa12538b05c 100644 +--- a/include/sfx2/objsh.hxx ++++ b/include/sfx2/objsh.hxx +@@ -438,6 +438,9 @@ public: + + static bool UnTrustedScript(const OUString& rScriptURL); + ++ /// Check if script URL whitelist exists, and if so, if current script url is part of it ++ static bool isScriptURLAllowed(const OUString& rScriptURL); ++ + static bool isScriptAccessAllowed(const css::uno::Reference& rScriptContext); + + SvKeyValueIterator* GetHeaderAttributes(); +diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx +index 2ac78c29582d..51f72afeb2c7 100644 +--- a/sfx2/source/doc/objmisc.cxx ++++ b/sfx2/source/doc/objmisc.cxx +@@ -84,6 +84,10 @@ + #include + #include + ++#include ++#include ++#include ++ + #include + #include + #include +@@ -1459,6 +1463,31 @@ ErrCode SfxObjectShell::CallBasic( std::u16string_view rMacro, + return nRet; + } + ++bool SfxObjectShell::isScriptURLAllowed(const OUString& rScriptURL) ++{ ++ std::optional> allowedEvents( ++ officecfg::Office::Common::Security::Scripting::AllowedDocumentEventURLs::get()); ++ // When AllowedDocumentEventURLs is empty, all event URLs are allowed ++ if (!allowedEvents) ++ return true; ++ ++ icu::ErrorCode status; ++ const uint32_t rMatcherFlags = UREGEX_CASE_INSENSITIVE; ++ icu::UnicodeString usInput(rScriptURL.getStr()); ++ const css::uno::Sequence& rAllowedEvents = *allowedEvents; ++ for (auto const& allowedEvent : rAllowedEvents) ++ { ++ icu::UnicodeString usRegex(allowedEvent.getStr()); ++ icu::RegexMatcher rmatch1(usRegex, usInput, rMatcherFlags, status); ++ if (rScriptURL.startsWith(allowedEvent) || rmatch1.matches(status)) ++ { ++ return true; ++ } ++ } ++ ++ return false; ++} ++ + bool SfxObjectShell::isScriptAccessAllowed( const Reference< XInterface >& _rxScriptContext ) + { + try +diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx +index 56aa8f95e75f..f552c1fa043e 100644 +--- a/sfx2/source/inc/eventsupplier.hxx ++++ b/sfx2/source/inc/eventsupplier.hxx +@@ -80,10 +80,6 @@ public: + ::comphelper::NamedValueCollection& o_normalizedDescriptor, + SfxObjectShell* i_document ); + static void Execute( css::uno::Sequence < css::beans::PropertyValue > const & aEventData, const css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc ); +- +-private: +- /// Check if script URL whitelist exists, and if so, if current script url is part of it +- static bool isScriptURLAllowed(const OUString& aScriptURL); + }; + + #endif +diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx +index be47bed36cfb..102621242dc6 100644 +--- a/sfx2/source/notify/eventsupplier.cxx ++++ b/sfx2/source/notify/eventsupplier.cxx +@@ -43,9 +43,6 @@ + #include + #include + +-#include +-#include +-#include + + using namespace css; + using namespace ::com::sun::star; +@@ -155,31 +152,6 @@ sal_Bool SAL_CALL SfxEvents_Impl::hasElements() + return maEventNames.hasElements(); + } + +-bool SfxEvents_Impl::isScriptURLAllowed(const OUString& aScriptURL) +-{ +- std::optional> allowedEvents( +- officecfg::Office::Common::Security::Scripting::AllowedDocumentEventURLs::get()); +- // When AllowedDocumentEventURLs is empty, all event URLs are allowed +- if (!allowedEvents) +- return true; +- +- icu::ErrorCode status; +- const uint32_t rMatcherFlags = UREGEX_CASE_INSENSITIVE; +- icu::UnicodeString usInput(aScriptURL.getStr()); +- const css::uno::Sequence& rAllowedEvents = *allowedEvents; +- for (auto const& allowedEvent : rAllowedEvents) +- { +- icu::UnicodeString usRegex(allowedEvent.getStr()); +- icu::RegexMatcher rmatch1(usRegex, usInput, rMatcherFlags, status); +- if (aScriptURL.startsWith(allowedEvent) || rmatch1.matches(status)) +- { +- return true; +- } +- } +- +- return false; +-} +- + void SfxEvents_Impl::Execute( css::uno::Sequence < css::beans::PropertyValue > const & aProperties, const document::DocumentEvent& aTrigger, SfxObjectShell* pDoc ) + { + OUString aType; +@@ -214,7 +186,7 @@ void SfxEvents_Impl::Execute( css::uno::Sequence < css::beans::PropertyValue > c + if (aScript.isEmpty()) + return; + +- if (!isScriptURLAllowed(aScript)) ++ if (!SfxObjectShell::isScriptURLAllowed(aScript)) + return; + + if (!pDoc) +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-84443-2.diff libreoffice-25.2.3/debian/patches/CVE-2026-84443-2.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-84443-2.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-84443-2.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,56 @@ +From 66ce23adcbfd13fbf692df399cf9c38d6e5246cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2026 14:35:44 +0000 +Subject: [PATCH] dbaccess: use the same script checks as an office document +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +a database document isn't an SfxObjectShell, so its bound event +scripts run from DocumentEventExecutor rather than from +SfxEvents_Impl::Execute + +Change-Id: I72cd173b95301c66c2c10932261bbccbf620c46b +Signed-off-by: Caolán McNamara +(cherry picked from commit 7993a7a1b0cccba429fb82ca3723d2ef50a39277) +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/11741 +Tested-by: Jenkins CPCI +--- + .../source/core/dataaccess/documenteventexecutor.cxx | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +index aebaf385e64b..2ce40b75a3f0 100644 +--- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx ++++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +@@ -27,8 +27,10 @@ + #include + + #include ++#include + #include + #include ++#include + #include + + namespace dbaccess +@@ -166,6 +168,16 @@ namespace dbaccess + + if ( bDispatchScriptURL && bNonEmptyScript ) + { ++ // the same three tests an office document takes before a bound script runs ++ if ( !SfxObjectShell::isScriptURLAllowed( sScript ) ) ++ return; ++ ++ if ( !SfxObjectShell::isScriptAccessAllowed( cppu::getXWeak( xDocument.get() ) ) ) ++ return; ++ ++ if ( SfxObjectShell::UnTrustedScript( sScript ) ) ++ return; ++ + lcl_dispatchScriptURL_throw( mxDocument, mxURLTransformer, sScript, Event ); + } + } +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-84443-3.diff libreoffice-25.2.3/debian/patches/CVE-2026-84443-3.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-84443-3.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-84443-3.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,37 @@ +From 1433367de6ecc6278e2103b45c59df9037f3ca87 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 Sep 2026 19:18:18 +0000 +Subject: [PATCH] dbaccess: decide the macro execution mode during load +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the mode was only decided when the first controller connected, which +is later than the other document types do it + +Change-Id: I2a9ab4af7c16a5b119af4b53ffe3aa39b78f8980 +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13630 +Tested-by: Jenkins CPCI +--- + engine/dbaccess/source/core/dataaccess/databasedocument.cxx | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a//dbaccess/source/core/dataaccess/databasedocument.cxx b//dbaccess/source/core/dataaccess/databasedocument.cxx +index ac1f4ac5072f..f9d4ee2e2d43 100644 +--- a//dbaccess/source/core/dataaccess/databasedocument.cxx ++++ b//dbaccess/source/core/dataaccess/databasedocument.cxx +@@ -766,6 +766,10 @@ bool ODatabaseDocument::impl_attachResource( const OUString& i_rLogicalDocumentU + + _rDocGuard.clear(); + // <- SYNCHRONIZED ++ ++ // decide the macro mode while the load arguments still hold the interaction handler ++ m_pImpl->checkMacrosOnLoading(); ++ + m_aEventNotifier.notifyDocumentEvent( u"OnLoadFinished"_ustr, nullptr, Any() ); + } + +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-97892.diff libreoffice-25.2.3/debian/patches/CVE-2026-97892.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-97892.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-97892.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,65 @@ +From fa2b7c85f0e82e1e641208a6a8cee115eb6ac599 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 22 Sep 2026 15:21:01 +0000 +Subject: [PATCH] check the byte ranges of a pdf signature against the file +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The offsets and lengths come from the document, so a range that is +not inside the file leaves the signature unchecked now. + +Signed-off-by: Caolán McNamara +Change-Id: I4c293d4c49326cb08336295714dec91d833bbd88 +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/13425 +Tested-by: Jenkins CPCI +--- + svl/source/crypto/cryptosign.cxx | 9 +++++++++ + xmlsecurity/source/helper/pdfsignaturehelper.cxx | 8 ++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx +index b245de24f103..f9e23c54d89a 100644 +--- a/svl/source/crypto/cryptosign.cxx ++++ b/svl/source/crypto/cryptosign.cxx +@@ -2203,9 +2203,18 @@ bool Signing::Verify(SvStream& rStream, + #if USE_CRYPTO_ANY + std::vector buffer; + ++ const sal_uInt64 nStreamSize = rStream.TellEnd(); ++ + // Copy the byte ranges into a single buffer. + for (const auto& rByteRange : aByteRanges) + { ++ // A signature covers a part of the file, so both ends of every range are inside it. ++ if (rByteRange.first > nStreamSize || rByteRange.second > nStreamSize - rByteRange.first) ++ { ++ SAL_WARN("svl.crypto", "Verify: byte range is outside the stream"); ++ return false; ++ } ++ + rStream.Seek(rByteRange.first); + const size_t size = buffer.size(); + buffer.resize(size + rByteRange.second); +diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx +index ebf5e83356a0..2dd6968059ab 100644 +--- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx ++++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx +@@ -130,6 +130,14 @@ void GetByteRangesFromPDF(const std::unique_ptr& pSig + size_t nByteRangeOffset = 0; + for (size_t i = 0; i < aByteRange.size(); ++i) + { ++ // Only offsets and lengths that are zero or more describe a part of the file. ++ if (aByteRange[i] < 0) ++ { ++ SAL_WARN("xmlsecurity.helper", "GetByteRangesFromPDF: negative byte range"); ++ rByteRanges.clear(); ++ return; ++ } ++ + if (i % 2 == 0) + { + nByteRangeOffset = aByteRange[i]; +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-97894.diff libreoffice-25.2.3/debian/patches/CVE-2026-97894.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-97894.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-97894.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,78 @@ +From 5fd786c19a175e071b4047c60d3130dfbd781325 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 15 Sep 2026 22:30:29 +0000 +Subject: [PATCH] ReadLine and ReadUniStringLine: stop at the limit in the loop +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the two have drifted apart, so check the limit as each character is +read instead of correcting the count afterwards + +Signed-off-by: Caolán McNamara +Change-Id: Idad62990843d58dfa13a69667295285ba4c7227f +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12715 +Reviewed-by: Miklos Vajna +Tested-by: Jenkins CPCI +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/12872 +--- + tools/source/stream/stream.cxx | 22 ++++++++++------------ + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx +index 16e5e0fbb703..87115691da23 100644 +--- a/tools/source/stream/stream.cxx ++++ b/tools/source/stream/stream.cxx +@@ -422,6 +422,11 @@ bool SvStream::ReadLine( OStringBuffer& aBuf, sal_Int32 nMaxBytesToRead ) + sal_uInt16 j, n; + for( j = n = 0; j < nLen ; ++j ) + { ++ if (nTotalLen + j >= o3tl::make_unsigned(nMaxBytesToRead)) ++ { ++ bEnd = true; ++ break; ++ } + c = buf[j]; + if ( c == '\n' || c == '\r' ) + { +@@ -433,12 +438,6 @@ bool SvStream::ReadLine( OStringBuffer& aBuf, sal_Int32 nMaxBytesToRead ) + ++n; + } + nTotalLen += j; +- if (nTotalLen > o3tl::make_unsigned(nMaxBytesToRead)) +- { +- n -= nTotalLen - nMaxBytesToRead; +- nTotalLen = nMaxBytesToRead; +- bEnd = true; +- } + if ( n ) + aBuf.append(buf, n); + } +@@ -498,6 +497,11 @@ bool SvStream::ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead + sal_uInt16 j, n; + for( j = n = 0; j < nLen ; ++j ) + { ++ if (nTotalLen + j >= o3tl::make_unsigned(nMaxCodepointsToRead)) ++ { ++ bEnd = true; ++ break; ++ } + if (m_isSwap) + SwapNumber( buf[n] ); + c = buf[j]; +@@ -518,12 +522,6 @@ bool SvStream::ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead + } + } + nTotalLen += j; +- if (nTotalLen > o3tl::make_unsigned(nMaxCodepointsToRead)) +- { +- n -= nTotalLen - nMaxCodepointsToRead; +- nTotalLen = nMaxCodepointsToRead; +- bEnd = true; +- } + if ( n ) + aBuf.append( buf, n ); + } +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-97999.diff libreoffice-25.2.3/debian/patches/CVE-2026-97999.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-97999.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-97999.diff 2026-11-13 16:33:01.000000000 +0000 @@ -0,0 +1,48 @@ +From 97419bee2b14ef6a977414f7fece703aa7d2a49c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Sep 2026 11:19:49 +0000 +Subject: [PATCH] firebird: size the setBytes grow check by sqllen +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +8000 was the default width the hsqldb migration gives a VARBINARY +column, but sqldata is allocated from sqllen, which is less than that +for a narrower column, so test against sqllen instead + +since: + +commit 54ddc4ff4c2ff7e8b2c502d6b475cfdc9b8e3cec +Date: Sat May 26 18:01:15 2018 +0200 + + tdf#117446: FB mig, (VAR)BINARY, fix memory management + +Change-Id: I2b55e3842a77f04a4bd0d2ae324b3c4c09988c37 +Signed-off-by: Caolán McNamara +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/12743 +Tested-by: Jenkins CPCI +Reviewed-by: Miklos Vajna +--- + connectivity/source/drivers/firebird/PreparedStatement.cxx | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx +index c1ebd314ea7e..c0702d3f39ab 100644 +--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx ++++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx +@@ -956,9 +956,9 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex, + setParameterNull(nParameterIndex, false); + const sal_Int32 nMaxSize = 0xFFFF; + const sal_uInt16 nSize = std::min(xBytes.getLength(), nMaxSize); +- // 8000 corresponds to value from lcl_addDefaultParameters +- // in dbaccess/source/filter/hsqldb/createparser.cxx +- if (nSize > 8000) ++ // sqldata was allocated from sqllen in mallocSQLVAR, so grow it whenever the value is ++ // longer than the column it is bound to. ++ if (nSize > pVar->sqllen) + { + free(pVar->sqldata); + pVar->sqldata = static_cast(malloc(sizeof(char) * nSize + 2)); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/CVE-2026-98100.diff libreoffice-25.2.3/debian/patches/CVE-2026-98100.diff --- libreoffice-25.2.3/debian/patches/CVE-2026-98100.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/CVE-2026-98100.diff 2026-11-13 16:29:23.000000000 +0000 @@ -0,0 +1,60 @@ +From 6b014b66ff3b3657edd07105d93ea1e77ad16b18 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 16 Sep 2026 12:12:57 +0000 +Subject: [PATCH] hwp: take the picture link target from inside the follow + block +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Caolán McNamara +Change-Id: Ifdd88a7949289d1f43e96eb4ecc05720e15d1f57 +Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12752 +Tested-by: Jenkins CPCI +Reviewed-by: Noel Grandin +Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/12806 +--- + hwpfilter/source/hwpreader.cxx | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx +index 568e07101c75..4f630fdf1c31 100644 +--- a/hwpfilter/source/hwpreader.cxx ++++ b/hwpfilter/source/hwpreader.cxx +@@ -3755,18 +3755,23 @@ void HwpReader::makePicture(Picture * hbox) + if( hbox->ishyper ) + { + mxList->addAttribute(u"xlink:type"_ustr, sXML_CDATA, u"simple"_ustr); ++ // The link target starts after the four byte tag and runs to the first NUL or to ++ // the end of the block, whichever comes first. ++ const std::string_view aFollow(reinterpret_cast(hbox->follow.data()), ++ hbox->follow.size()); ++ const size_t nStart = (aFollow.size() > 4 && aFollow[4] != 0) ? 4 : 5; ++ std::string aTarget; ++ if (nStart < aFollow.size()) ++ { ++ const std::string_view aRest = aFollow.substr(nStart); ++ aTarget = aRest.substr(0, aRest.find('\0')); ++ } + #ifdef _WIN32 +- if( hbox->follow[4] != 0 ) +- mxList->addAttribute("xlink:href", sXML_CDATA, hstr2OUString(kstr2hstr(hbox->follow.data() + 4).c_str())); +- else +- mxList->addAttribute("xlink:href", sXML_CDATA, hstr2OUString(kstr2hstr(hbox->follow.data() + 5).c_str())); ++ mxList->addAttribute("xlink:href", sXML_CDATA, ++ hstr2OUString(kstr2hstr(reinterpret_cast(aTarget.c_str())).c_str())); + #else +- if( hbox->follow[4] != 0 ) +- mxList->addAttribute(u"xlink:href"_ustr, sXML_CDATA, +- hstr2OUString(kstr2hstr(reinterpret_cast(urltounix(reinterpret_cast(hbox->follow.data() + 4)).c_str())).c_str())); +- else +- mxList->addAttribute(u"xlink:href"_ustr, sXML_CDATA, +- hstr2OUString(kstr2hstr(reinterpret_cast(urltounix(reinterpret_cast(hbox->follow.data() + 5)).c_str())).c_str())); ++ mxList->addAttribute(u"xlink:href"_ustr, sXML_CDATA, ++ hstr2OUString(kstr2hstr(reinterpret_cast(urltounix(aTarget.c_str()).c_str())).c_str())); + #endif + startEl(u"draw:a"_ustr); + mxList->clear(); +-- +2.47.3 + diff -Nru libreoffice-25.2.3/debian/patches/e12c061dbf1330b00cdc73b7691171b6af883764.diff libreoffice-25.2.3/debian/patches/e12c061dbf1330b00cdc73b7691171b6af883764.diff --- libreoffice-25.2.3/debian/patches/e12c061dbf1330b00cdc73b7691171b6af883764.diff 1970-01-01 00:00:00.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/e12c061dbf1330b00cdc73b7691171b6af883764.diff 2026-11-16 15:05:44.000000000 +0000 @@ -0,0 +1,52 @@ +diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx +index 9a6a9e159898..0f07bc346518 100644 +--- a/sw/source/filter/ww8/docxexport.cxx ++++ b/sw/source/filter/ww8/docxexport.cxx +@@ -1783,6 +1783,7 @@ void DocxExport::WriteCustomXml() + + for (sal_Int32 j = 0; j < customXmlDomlist.getLength(); j++) + { ++ uno::Reference < css::io::XOutputStream > xCustomXmlItemOutStream; + const uno::Reference& customXmlDom = customXmlDomlist[j]; + const uno::Reference& customXmlDomProps = customXmlDomPropslist[j]; + if (customXmlDom.is()) +@@ -1794,8 +1795,8 @@ void DocxExport::WriteCustomXml() + uno::Reference< xml::sax::XSAXSerializable > serializer( customXmlDom, uno::UNO_QUERY ); + uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() ); + +- uno::Reference < css::io::XOutputStream > xOutStream = GetFilter().openFragmentStream("customXml/item" + OUString::number(j + 1) + ".xml", +- u"application/xml"_ustr); ++ xCustomXmlItemOutStream = GetFilter().openFragmentStream( ++ "customXml/item" + OUString::number(j + 1) + ".xml", u"application/xml"_ustr); + if (m_SdtData.size()) + { + // There are some SDT blocks data with data bindings which can update some custom xml values +@@ -1815,7 +1816,8 @@ void DocxExport::WriteCustomXml() + if (i == m_SdtData.size() - 1) + { + // last transformation +- lcl_UpdateXmlValues(m_SdtData[i], xXSLTInStream->getInputStream(), xOutStream); ++ lcl_UpdateXmlValues( ++ m_SdtData[i], xXSLTInStream->getInputStream(), xCustomXmlItemOutStream); + } + else + { +@@ -1829,7 +1831,7 @@ void DocxExport::WriteCustomXml() + } + else + { +- writer->setOutputStream(xOutStream); ++ writer->setOutputStream(xCustomXmlItemOutStream); + + serializer->serialize(writer, uno::Sequence< beans::StringPair >()); + } +@@ -1844,8 +1846,7 @@ void DocxExport::WriteCustomXml() + serializer->serialize(writer, uno::Sequence< beans::StringPair >()); + + // Adding itemprops's relationship entry to item.xml.rels file +- m_rFilter.addRelation( GetFilter().openFragmentStream( "customXml/item"+OUString::number(j+1)+".xml", +- u"application/xml"_ustr ) , ++ m_rFilter.addRelation(xCustomXmlItemOutStream, + oox::getRelationship(Relationship::CUSTOMXMLPROPS), + Concat2View("itemProps"+OUString::number(j+1)+".xml" )); + } diff -Nru libreoffice-25.2.3/debian/patches/series libreoffice-25.2.3/debian/patches/series --- libreoffice-25.2.3/debian/patches/series 2026-11-06 19:45:29.000000000 +0000 +++ libreoffice-25.2.3/debian/patches/series 2026-11-16 15:10:20.000000000 +0000 @@ -90,4 +90,59 @@ firebird-module-path.diff firebird-call-writeFile-outside-the-SAL_WARN_IF-cond.patch CVE-2026-76181.diff +CVE-2026-18563-1.diff +CVE-2026-18563-2.diff +CVE-2026-18563-3.diff +CVE-2026-18563-4.diff +CVE-2026-18563-5.diff +CVE-2026-18563-6.diff +CVE-2026-18563-7.diff +CVE-2026-18563-8.diff +CVE-2026-18563-9.diff +CVE-2026-18563-10.diff +CVE-2026-18563-11.diff +CVE-2026-18563-12.diff +CVE-2026-18563-13.diff +CVE-2026-18564.diff +CVE-2026-18565.diff +CVE-2026-18566-1.diff +CVE-2026-18566-2.diff +CVE-2026-18566-3.diff +CVE-2026-18566-4.diff +CVE-2026-18566-5.diff +CVE-2026-18566-6.diff +CVE-2026-18566-7.diff +CVE-2026-18566-8.diff +CVE-2026-18566-9.diff +CVE-2026-18566-10.diff +CVE-2026-18566-11.diff +CVE-2026-84234.diff +CVE-2026-98100.diff +CVE-2026-101351.diff +CVE-2026-101352-1.diff +CVE-2026-101352-2.diff +CVE-2026-101352-3.diff +CVE-2026-101353-1.diff +CVE-2026-101353-2.diff +CVE-2026-101353-3.diff +CVE-2026-101353-4.diff +CVE-2026-104007-1.diff +CVE-2026-104007-2.diff +CVE-2026-104007-3.diff +CVE-2026-104692-1.diff +CVE-2026-104692-2.diff +CVE-2026-101892.diff +CVE-2026-101929.diff +CVE-2026-101930.diff +CVE-2026-101933-1.diff +CVE-2026-101933-2.diff +CVE-2026-104920.diff +CVE-2026-84443-1.diff +CVE-2026-84443-2.diff +CVE-2026-84443-3.diff +CVE-2026-97892.diff +CVE-2026-97894.diff +CVE-2026-97999.diff +CVE-2026-104933.diff +CVE-2026-108169.diff