From: Caolán McNamara Date: Sat, 4 Nov 2023 19:57:51 +0000 (+0000) Subject: [3/6] CVE-2023-6186 warn about exotic protocols as well X-Git-Tag: archive/raspbian/1%6.1.5-3+rpi1+deb10u11^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7d5b86e785670702c985c372f9fe511da84de924;p=libreoffice.git [3/6] CVE-2023-6186 warn about exotic protocols as well Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158902 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna (cherry picked from commit aafe05584e601236e84a165f2816b187189cfb77) (cherry picked from commit 799f0225d7171e6c04324ace1f31c7fe976662a4) (cherry picked from commit ae06669597e5a485676ba4394822cba8bb88d394) (cherry picked from commit a7138808fbb8eb263af436ee4227cbe9c829b676) (cherry picked from commit 19316aacbb9f1774565a157d21e70c88c490cef6) (cherry picked from commit 13c0bdee068ad4af1f4e03461580ec7bddeb0d63) (cherry picked from commit f7f3aab1c9f49a4e56711c7fd3b32da793b00a43) Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f Gbp-Pq: Name 0084-3-6-CVE-2023-6186-warn-about-exotic-protocols-as-wel.patch --- diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 955eeab36ee..859dbea3ab8 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1008,7 +1008,7 @@ void SwHTMLParser::InsertFloatingFrame() OUString sHRef = aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); - if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(sHRef).IsExoticProtocol()) NotifyMacroEventRead(); xSet->setPropertyValue("FrameURL", uno::makeAny( sHRef ) ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 8366f0ae380..a786ace2f2a 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -857,7 +857,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra OUString sHRef = URIHelper::SmartRel2Abs( INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ); - if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(sHRef).IsExoticProtocol()) GetXMLImport().NotifyMacroEventRead(); xSet->setPropertyValue("FrameURL", diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index de34ff30642..bb84332e0fa 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4962,7 +4962,8 @@ bool INetURLObject::IsExoticProtocol() const return m_eScheme == INetProtocol::Slot || m_eScheme == INetProtocol::Macro || m_eScheme == INetProtocol::Uno || - isSchemeEqualTo(u"vnd.sun.star.script"); + isSchemeEqualTo(u"vnd.sun.star.script") || + isSchemeEqualTo(u"service"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 2ee7a98be54..8adbfd794dd 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3275,7 +3275,7 @@ void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< cs if( !maHref.isEmpty() ) { - if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro) + if (INetURLObject(maHref).IsExoticProtocol()) GetImport().NotifyMacroEventRead(); xProps->setPropertyValue("FrameURL", Any(maHref) );