From 771515df031706cf88101c9de500a1d88e7ac03e Mon Sep 17 00:00:00 2001 From: Eduard Abdullin <55892454+eabdullin1@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:39:35 +0300 Subject: [PATCH] Sync with stable --- SOURCES/0001-CVE-2022-38745.patch | 93 ++ ...on-t-use-Library_tl-in-URE-libraries.patch | 364 +++++++ ...parameter-count-for-OR-AND-and-1-par.patch | 77 ++ ...trap-should-not-depend-on-Library_co.patch | 32 + SOURCES/0001-disable-script-dump.patch | 99 ++ .../0001-set-Referer-on-loading-IFrames.patch | 91 ++ ...ty-belt-before-fishing-in-muddy-wate.patch | 72 ++ ...g-frames-under-managed-links-control.patch | 896 ++++++++++++++++++ ...-a-result-even-if-it-s-only-an-error.patch | 50 + ...me-script-macro-support-isn-t-needed.patch | 53 ++ ...140-Filter-out-unwanted-command-URIs.patch | 292 ++++++ SPECS/libreoffice.spec | 44 +- 12 files changed, 2148 insertions(+), 15 deletions(-) create mode 100644 SOURCES/0001-CVE-2022-38745.patch create mode 100644 SOURCES/0001-Don-t-use-Library_tl-in-URE-libraries.patch create mode 100644 SOURCES/0001-Obtain-actual-0-parameter-count-for-OR-AND-and-1-par.patch create mode 100644 SOURCES/0001-URE-Library_boostrap-should-not-depend-on-Library_co.patch create mode 100644 SOURCES/0001-disable-script-dump.patch create mode 100644 SOURCES/0001-set-Referer-on-loading-IFrames.patch create mode 100644 SOURCES/0002-Stack-check-safety-belt-before-fishing-in-muddy-wate.patch create mode 100644 SOURCES/0002-put-floating-frames-under-managed-links-control.patch create mode 100644 SOURCES/0003-Always-push-a-result-even-if-it-s-only-an-error.patch create mode 100644 SOURCES/0003-assume-IFrame-script-macro-support-isn-t-needed.patch create mode 100644 SOURCES/0005-CVE-2022-3140-Filter-out-unwanted-command-URIs.patch diff --git a/SOURCES/0001-CVE-2022-38745.patch b/SOURCES/0001-CVE-2022-38745.patch new file mode 100644 index 0000000..01dde2d --- /dev/null +++ b/SOURCES/0001-CVE-2022-38745.patch @@ -0,0 +1,93 @@ +From dbf825c25195e29a00228f31112c5aaa2102f692 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Mon, 21 Feb 2022 11:55:21 +0100 +Subject: [PATCH] Avoid unnecessary empty -Djava.class.path= + +Change-Id: Idcfe7321077b60381c0273910b1faeb444ef1fd8 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242 +Tested-by: Jenkins +Reviewed-by: Stephan Bergmann +--- + .../plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 16 +++++++++++++--- + jvmfwk/source/framework.cxx | 8 ++++++-- + jvmfwk/source/fwkbase.cxx | 3 +++ + 3 files changed, 22 insertions(+), 5 deletions(-) + +diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +index f47b0a3..843f6d1 100644 +--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx ++++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +@@ -713,17 +713,22 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( + // all versions below 1.5.1 + options.emplace_back("abort", reinterpret_cast(abort_handler)); + bool hasStackSize = false; ++#ifdef UNX ++ // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2) ++ // in the class path in order to have applet support: ++ OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); ++#endif + for (int i = 0; i < cOptions; i++) + { + OString opt(arOptions[i].optionString); + #ifdef UNX +- // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2) +- // in the class path in order to have applet support: + if (opt.startsWith("-Djava.class.path=")) + { +- OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); + if (!sAddPath.isEmpty()) ++ { + opt += OStringChar(SAL_PATHSEPARATOR) + sAddPath; ++ sAddPath.clear(); ++ } + } + #endif + if (opt == "-Xint") { +@@ -768,6 +773,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( + } + #endif + } ++#ifdef UNX ++ if (!sAddPath.isEmpty()) { ++ options.emplace_back("-Djava.class.path=" + sAddPath, nullptr); ++ } ++#endif + + std::unique_ptr sarOptions(new JavaVMOption[options.size()]); + for (std::vector