explictly-exclude-LibreLogo-from-XScript-usage
authorDebian LibreOffice Maintainers <debian-openoffice@lists.debian.org>
Fri, 6 Sep 2019 09:53:15 +0000 (10:53 +0100)
committerRene Engelhard <rene@debian.org>
Fri, 6 Sep 2019 09:53:15 +0000 (10:53 +0100)
Gbp-Pq: Name explictly-exclude-LibreLogo-from-XScript-usage.diff

sfx2/source/doc/objmisc.cxx

index 902e96ccea05945d9cb8474e40036a4fbd3e3608..3016315cd17bfd91a43c8b1f520b3a96e4e9316c 100644 (file)
@@ -1461,6 +1461,16 @@ namespace
     }
 }
 
+namespace {
+
+// don't allow LibreLogo to be used with our mouseover/etc dom-alike events
+bool UnTrustedScript(const OUString& rScriptURL)
+{
+    return rScriptURL.startsWithIgnoreAsciiCase("vnd.sun.star.script:LibreLogo");
+}
+
+}
+
 ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const OUString& _rScriptURL,
     const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const css::uno::Any* pCaller )
 {
@@ -1473,6 +1483,9 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
     if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( _rxScriptContext ) )
         return ERRCODE_IO_ACCESSDENIED;
 
+    if ( UnTrustedScript(_rScriptURL) )
+        return ERRCODE_IO_ACCESSDENIED;
+
     bool bCaughtException = false;
     Any aException;
     try