Author SHA1 Message Date
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
3 changed files with 15 additions and 11 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
@@ -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();
+7 -7
View File
@@ -190,7 +190,7 @@ 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.15.0' // the API of log4j 2
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 +231,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.15.0' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.15.0' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.15.0' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.15.0' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.15.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 +296,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