Author SHA1 Message Date
Jacques Le Roux ddc238a49d Fixed: Bug in HtmlFormMacroLibrary.ftl::makeHyperlinkString macro (OFBIZ-12468)
Fixes a typo I already fixed in trunk but forgot in demo
2021-12-19 10:29:21 +01:00
Jacques Le Roux 4cff613b18 Fixed: [SECURITY] CVE-2021-45105: Apache Log4j2 (OFBIZ-12470)
The configuration seems to have changed.

log4j-slf4j18-impl available in Maven as 2.16.0 is not in 2.17.0.
Also log4j-web is now needed. In R18 as compile when in trunk as readonly...

I was guided by this block in console.log of trunk demo:
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/util/SetUtils
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.getConfigURI(Log4jWebInitializerImpl.java:196)
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:175)
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:112)
	at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

I'll dbl-check why, notably about log4j-slf4j18-impl.
At least it works well like that.
2021-12-19 08:59:42 +01:00
Jacques Le Roux 4442c2adca Fixed: [SECURITY] CVE-2021-45105: Apache Log4j2 (OFBIZ-12470)
CVE-2021-45105: Apache Log4j2 versions 2.0-alpha1 through 2.16.0 does not protect
from uncontrolled recursion from self-referential lookups. This allows an
attacker with control over Thread Context Map data to cause a denial of service
when a crafted string is interpreted.
This issue is fixed in Log4j 2.17.0.:
https://logging.apache.org/log4j/2.x/security.html
2021-12-19 03:30:49 +01:00
Jacques Le Roux 80262418fd Fixed: Bug in HtmlFormMacroLibrary.ftl::makeHyperlinkString macro (OFBIZ-12468)
I was unable to reproduce the error, but according to
https://stackoverflow.com/questions/51524640/why-does-freemarkers-built-in-is-string-return-true-for-an-object
The solution is to check for targetParameters not being an hash

Actually this was not the reason of the 1.7GB console log, another Jira to come
2021-12-18 11:48:21 +01:00
Jacques Le Roux a48938982d Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
Comment out the XMLRPC tests. This alone should allow Buildbot 3.2 to run the
integration tests.

Conflict handled by hand
2021-12-16 07:11:01 +01:00
Jacques Le Roux 901ca14f44 Improved: no functional change, update /lib/README to use Maven search 2021-12-16 06:52:26 +01:00
Jacques Le Roux a42ea2bdb4 Improved: no functional change, link to Gradle and CodeQl workflows were wrong in badge
This allows now users to get directly to these workflows by clicking on the icon
2021-12-16 06:47:29 +01:00
Jacques Le Roux e2026b6a50 Improved: no functional change, link to repo was wrong in badge
This allows now users to get directly to the repo by clicking on the icon
2021-12-15 17:11:41 +01:00
Jacques Le Roux e83559d151 Improved: Apache Log4j2 (OFBIZ-12449)
Updates log4j2 from 2.15.0 to 2.16.0 because of
https://lists.apache.org/thread/d6v4r6nosxysyq9rvnr779336yf0woz4

It's not a security issue, I lazily use OFBIZ-12449 because it can improve
security even if it's not necessary (dixit the announce)
2021-12-14 12:29:32 +01:00
Mathieu Lirzin 4d43e6ed87 Fixed: All local XML schema files are now present in classpath, Backport form trunk
(OFBIZ-11132) (OFBIZ-12437)

Previously there was some warnings about missing “.xsd” files that
‘UtilXml#resolveEntity’ failed to find in classpath.  This has been
fixed by declaring all “dtd” directories inside components as resources.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862346 13f79535-47bb-0310-9956-ffa450edef68
2021-12-12 12:07:40 +01:00
Jacques Le Roux bccf14066c Fixed: [SECURITY] CVE-2021-44228: Apache Log4j2 (OFBIZ-12449)
CVE-2021-44228: Apache Log4j2 JNDI features do not protect against attacker
controlled LDAP and other JNDI related endpoints:
https://logging.apache.org/log4j/2.x/security.html

I'm not sure we are concerned, have no time to check, better safe than sorry...
2021-12-11 17:37:33 +01:00
Jacques Le Roux 14f7feda74 Improved: The SARIF file generated by CodeQL for Java classes is too large (OFBIZ-12361)
It still does not work
2021-11-23 13:25:29 +01:00
Jacques Le Roux d5883a855d Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
According to
https://github.com/github/vscode-codeql/pull/1004
https://github.com/github/vscode-codeql/issues/735
this should now work. Let's try...
2021-11-23 11:32:08 +01:00
rohitkouandRohit Koushal 2222bd21b7 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307) (#352)
Fixed the Additional image uploading issue which got somehow missed in service addAdditionalViewForProduct.

Co-authored-by: Rohit Koushal <rohit.koushal39@gmail.com>
2021-11-23 10:40:02 +01:00
7 changed files with 24 additions and 18 deletions
+4 -3
View File
@@ -31,7 +31,7 @@ on:
- '**.js'
pull_request:
# The branches below must be a subset of the branches above
branches: [ release* ]
branches: [ trunk ]
paths:
- '**.java'
- '**.js'
@@ -51,7 +51,8 @@ jobs:
fail-fast: false
matrix:
#language: [ 'java', 'javascript' ]
language: [ 'javascript' ]
language: [ 'javascript' ]
#language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
@@ -65,6 +66,7 @@ jobs:
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
debug: true
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -88,4 +90,3 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
+3 -3
View File
@@ -20,9 +20,9 @@ under the License.
= Apache OFBiz®
image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link=http://www.apache.org/licenses/LICENSE-2.0]
image:https://img.shields.io/badge/Version-release18.12-green.svg[link=Version]
image:https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml/badge.svg?branch=release18.12]
image:https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml/badge.svg?branch=release18.12]
image:https://img.shields.io/badge/Version-release18.12-green.svg[link=https://github.com/apache/ofbiz-framework/tree/release18.12]
image:https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml]
image:https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml]
image:https://qpkb254zxeu.montastic.io/badge[link=https://qpkb254zxeu.montastic.io]
@@ -1055,10 +1055,13 @@ public class ProductServices {
String fileToCheck = imageServerPath + "/" + fileLocation + "." + extension.getString("fileExtensionId");
File file = new File(fileToCheck);
try {
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(fileToCheck, "Image", delegator)) {
Path tempFile = Files.createTempFile(null, null);
Files.write(tempFile, imageData.array(), StandardOpenOption.APPEND);
if (!org.apache.ofbiz.security.SecuredUpload.isValidFile(tempFile.toString(), "Image", delegator)) {
String errorMessage = UtilProperties.getMessage("SecurityUiLabels", "SupportedImageFormats", locale);
return ServiceUtil.returnError(errorMessage);
}
Files.delete(tempFile);
RandomAccessFile out = new RandomAccessFile(fileToCheck, "rw");
out.write(imageData.array());
out.close();
+8 -7
View File
@@ -190,7 +190,8 @@ dependencies {
compile 'org.apache.geronimo.components:geronimo-transaction:3.1.4'
compile 'org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1'
compile 'org.apache.httpcomponents:httpclient-cache:4.5.6'
compile 'org.apache.logging.log4j:log4j-api:2.11.1' // the API of log4j 2
compile 'org.apache.logging.log4j:log4j-api:2.17.0' // the API of log4j 2
compile 'org.apache.logging.log4j:log4j-web:2.17.0' //???
compile 'org.apache.poi:poi:3.17'
compile 'org.apache.pdfbox:pdfbox:2.0.24'
compile 'org.apache.shiro:shiro-core:1.4.0'
@@ -231,11 +232,11 @@ dependencies {
runtime 'org.apache.axis2:axis2-transport-local:1.7.8'
runtime 'org.apache.derby:derby:10.14.2.0'
runtime 'org.apache.geronimo.specs:geronimo-jaxrpc_1.1_spec:1.1'
runtime 'org.apache.logging.log4j:log4j-1.2-api:2.11.1' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.11.1' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.11.1' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.1' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.11.1' // need to constrain to version to avoid classpath conflict (ReflectionUtil)
runtime 'org.apache.logging.log4j:log4j-1.2-api:2.17.0' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.17.0' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.17.0' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.0' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.17.0' // need to constrain to version to avoid classpath conflict (ReflectionUtil)
runtime 'org.codeartisans.thirdparties.swing:batik-all:1.8pre-r1084380'
// plugin libs
@@ -296,7 +297,7 @@ sourceSets {
resources {
srcDirs = getDirectoryInActiveComponentsIfExists('src/main/java')
srcDirs += getDirectoryInActiveComponentsIfExists('config')
srcDirs += "${rootDir}/framework/base/dtd"
srcDirs += getDirectoryInActiveComponentsIfExists('dtd')
exclude excludedJavaSources
exclude excludedConfigFiles
// Below are necessary for unit tests run by Gradle and integration tests
+3 -2
View File
@@ -67,10 +67,11 @@ under the License.
<entity-xml action="assert" entity-xml-url="component://service/testdef/data/ServiceEcaGlobalEventAssertData.xml"/>
</test-case>
<test-case case-name="service-xml-rpc">
<!-- This alone should allow Buildbot 3.2 to run the integration tests, cf OFBIZ-12456 -->
<!-- <test-case case-name="service-xml-rpc">
<junit-test-suite class-name="org.apache.ofbiz.service.test.XmlRpcTests"/>
</test-case>
<test-case case-name="service-xml-rpc-local-engine">
<service-test service-name="testXmlRpcClientAdd"/>
</test-case>
</test-case!-->
</test-suite>
+1 -1
View File
@@ -3,4 +3,4 @@ Place your custom jar files in here.
If you want to use a public open source library, it is recommended
that you do not place the library in here. Instead declare it as a
dependency in your build scripts (build.gradle files) by finding the
appropriate library in jcenter (https://bintray.com/bintray/jcenter)
appropriate library in Maven (https://search.maven.org/)
@@ -695,7 +695,7 @@ Parameter: delegatorName, String, optional - name of the delegator in context.
<#macro makeHyperlinkString hiddenFormName imgSrc title alternate linkUrl description linkStyle="" event="" action="" targetParameters="" targetWindow="" confirmation="" uniqueItemName="" height="" width="" id="">
<#if uniqueItemName?has_content>
<#local params = "{&quot;presentation&quot;: &quot;layer&quot;">
<#if targetParameters?has_content>
<#if targetParameters?has_content && !targetParameters?is_hash>
<#local parameterMap = targetParameters?eval>
<#local parameterKeys = parameterMap?keys>
<#list parameterKeys as key>