explictly-exclude-LibreLogo-from-XScript-usage
authorDebian LibreOffice Maintainers <debian-openoffice@lists.debian.org>
Mon, 8 Mar 2021 12:13:24 +0000 (12:13 +0000)
committerRene Engelhard <rene@debian.org>
Mon, 8 Mar 2021 12:13:24 +0000 (12:13 +0000)
Gbp-Pq: Name explictly-exclude-LibreLogo-from-XScript-usage.diff

sfx2/source/doc/objmisc.cxx

index 8bee369851ecf1b5d6a8a08f89d7de274241519c..8594e9522e48cda82f31eb594e32e0aae13aeb1d 100644 (file)
@@ -1346,6 +1346,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 )
 {
@@ -1358,6 +1368,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