Author SHA1 Message Date
Jacques Le Roux 717bd4ba43 Fixed: Secure the uploads (OFBIZ-12080)
Reopened after report of a bug (only on *nix systems) by Shrilesh Korgaonkar.
This fixes the issue

Thanks: Shrilesh Korgaonkar
2021-04-16 09:24:52 +02:00
Jacques Le Roux 564b605d55 Improved: Replace Bintray by a new place to upload the Gradle Wrapper (OFBIZ-12192)
The checksum part was missing in Windows init-gradle-wrapper.ps1 script

I have noticed 2 points:
1. We should use SHA256, not SHA1
2. The unix-like shell script in OFBiz misses checksum verification in case
shasum command is not installed. In other words, if I launch the script it would
fail with "shasum not found, the downloaded files could not be verified".
However, the file will be kept there, so the user could launch unverified jar.

Last point was reported by Vladimir Sitnikov at LEGAL-288
2021-04-10 14:10:43 +02:00
Jacques Le Roux 2ce14c8fe1 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
Accidentally removed PartyServices::createRoleType
2021-04-08 13:47:47 +02:00
wpaetzold 7af07c808b Fixed: Error while deleting a Facility because of an existing (#291)
FacilityLocationGeoPoint (OFBIZ-12222)

Adds a service to delete a FacilityLocationGeoPoint
2021-04-08 11:53:12 +02:00
bjugl f089d59389 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an OUT
contactMechTypeId paramter and the call on this end has not been modified."

jleroux: I fixed lines too long
File PartyServices.java
Error Description	Line
La ligne excède 150 caractères (trouvé 178).	2621
La ligne excède 150 caractères (trouvé 178).	2638
La ligne excède 150 caractères (trouvé 191).	2655

Conflicts handled by hand
2021-04-08 11:40:42 +02:00
bjugl 8ef5896077 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an
OUT contactMechTypeId paramter and the call on this end has not been modified."

Conflicts handled by hand in PartyServices.java
I let the changes coming from trunk, too much to revert by hand
2021-04-08 11:28:47 +02:00
Jacques Le Roux 57183eea13 Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
In SafeObjectInputStream.properties
  Renames listOfSafeObjectsForInputStream to allowList and fixes it
  Introduces a denyList

Adapts SafeObjectInputStream class to new denyList

Conflicts handled by hand
  framework/base/config/SafeObjectInputStream.properties
  framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
2021-04-07 09:19:20 +02:00
Jacques Le Roux 27adfed9f0 Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
Prevents generics markup in string type names.

Conflict handled by hand
  framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
2021-04-05 17:05:32 +02:00
Jacques Le Roux 02cd3b33b0 Fixed: updates Tika because of CVE-2021-2865 2021-03-30 17:20:34 +02:00
Jacques Le Roux 1a5bca9190 Improved: Improve UtilObject class (OFBIZ-12216)
This removes the inoffensive but annoying message in log (which does not show in
trunk, see https://github.com/apache/ofbiz-framework/commit/27c9180/

Not the same as in trunk, simply handling with exception Rather than returning
null, also shorten java.rmi.server to java.rmi to block more cases
2021-03-30 12:38:36 +02:00
Aditya Sharma d75ef8212d Fixed: Form to add an employee position doesn't function properly when invoked from Humanres tree (OFBIZ-11684)
Replaced logic to ajaxify the response from EditEmplPosition with navigating user to EditEmplPosition page.
When we are getting the entire page and updating it into the DOM, it would be better if we navigate user to the page.
Issue with the current approach is current page and the EditEmplPosition page both have GlobalActions decorator all the js files in GlobalActions are loaded twice. Either we should ajaxify a section of page or we should navigate user to the EditEmplPosition page.

Thanks Pierre Smits for reporting the issue and Sebastian Berg, Michael Brohl, & Jacques Le Roux for the discussion and efforts
2021-03-30 10:59:19 +05:30
Jacques Le Roux 703a32b41f Improved: Comment out the SOAP and HTTP engines (OFBIZ-12212)
The SOAP and HTTP engines are open doors to security issues.
At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out
as we did for RMI in the past.
Of cause it must be clearly documented how to use them if needed.

Here is the email content:

    After the recent fix for the CVE-2021-26295[1] we discussed with the security
    team about the opportunity need to comment out the SOAP and HTTP engines
    like we did in the past for RMI[2], this obviously for security reason.

    [1] OFBIZ-12167 "Adds a blacklist (to be
    renamed soon to denylist) in Java serialisation (CVE-2021-26295)"
    [2] OFBIZ-6942 "Comment out RMI related
    code because of the Java deserialization issue [CVE-2016-2170] "

I just put a small comment in webtools controller, it should be enough.

The tests pass
2021-03-29 13:19:49 +02:00
Jacques Le Roux 9510fc9389 Fixed: addImageForProduct fails (OFBIZ-12211)
The addImageForProduct  process is not directly uploading a file but renames it
before.So there is a hyphen, and possibly a pair or parenthesis in case of
duplicate files, added to the file name.

In this commit I have also added the possibility to use underscores and spaces
in the original filename
2021-03-29 11:09:08 +02:00
Jacques Le Roux 7fb8780c97 Fixed: Invalid Currency symbol in income statement csv export (OFBIZ-12108)
1. Navigate to URL: accounting/control/IncomeStatement?organizationPartyId=Company
2. In income statement section click on export as csv button.
3. The exported csv has correct balance but with invalid currency symbol.
4. On screen USD $ symbol is shown and in csv some other currency symbol is shown.

Thanks: Lalit Dashora for report, Praveen Sharma for the fix
2021-03-28 13:31:47 +02:00
Suraj Khurana 921db68bde Fixed: ChangeReason was not being set on OrderStatus when orderItem was marked cancelled with reason.
(OFBIZ-12210)
Thanks Lalit Dashora for reporting the issue and providing the patch.
2021-03-27 16:29:30 +05:30
Jacques Le Roux 6b1d71d91a Fixed: Secure the uploads (OFBIZ-12080)
Fixes an issue reported by 赖涵 <1044309102@qq.com>: "Any file upload and delete
in latest Apache OFBiz"

It was a simple syntax error on my side
2021-03-26 19:15:10 +01:00
Jacques Le Roux c4c3012916 Improved: Secure the uploads (OFBIZ-12080)
Improves the error message for the file name part
2021-03-24 19:12:03 +01:00
Jacques Le Roux ac1595b304 Improved: Update Freemaker to 2.3.31 in R17 and R18 (OFBIZ-12196)
That's for (low) security reason. There are no bugs in R17 and R18 but after
reading about FREEMARKER-124 at
https://freemarker.apache.org/docs/versions_2_3_30.html
I believe we should update update Freemaker to 2.3.31 in R17 and R18
2021-03-22 11:08:54 +01:00
Jacques Le Roux 15bb640a83 Fixed: Upgrade Apache PDFBox to 2.0.23 because of CVE-2021-27807 and CVE-2021-27906 (OFBIZ-12205)
Currently we don't declare any dependency on PDFBox. I guess because it's used
as a 3rd party by another lib. Fortunately it's easily done.
2021-03-21 16:38:52 +01:00
18 changed files with 573 additions and 461 deletions
@@ -891,6 +891,11 @@ under the License.
<set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/>
<set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/>
<set field="glFiscalTypeId" from-field="parameters.glFiscalTypeId" default-value="ACTUAL"/>
<service service-name="getPartyAccountingPreferences" result-map="result">
<field-map field-name="organizationPartyId" value="${groovy:parameters.get('ApplicationDecorator|organizationPartyId')}"/>
</service>
<set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
<set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
<script location="component://accounting/groovyScripts/reports/IncomeStatement.groovy"/>
</actions>
<widgets>
@@ -121,19 +121,7 @@ var rawdata = [
EmpPosition: {
label: "Add Employee Position",
action: function (NODE, TREE_OBJ) {
var dataSet = {};
dataSet = {"partyId" : NODE.attr("id")};
jQuery.ajax({
type: "GET",
url: "EditEmplPosition",
data: dataSet,
error: function(msg) {
alert("An error occurred loading content! : " + msg);
},
success: function(msg) {
jQuery('div.page-container').html(msg);
}
});
window.location.href = "EditEmplPosition?partyId=" + NODE.attr("id");
}
},
AddIntOrg: {
@@ -2119,14 +2119,14 @@ public class OrderServices {
}
}
String reasonEnumId = null;
if (UtilValidate.isNotEmpty(itemReasonMap)) {
reasonEnumId = itemReasonMap.get(orderItem.getString("orderItemSeqId"));
}
// create order item change record
if (!"Y".equals(orderItem.getString("isPromo"))) {
String reasonEnumId = null;
String changeComments = null;
if (UtilValidate.isNotEmpty(itemReasonMap)) {
reasonEnumId = itemReasonMap.get(orderItem.getString("orderItemSeqId"));
}
if (UtilValidate.isNotEmpty(itemCommentMap)) {
changeComments = itemCommentMap.get(orderItem.getString("orderItemSeqId"));
}
@@ -2174,7 +2174,7 @@ public class OrderServices {
}
}
// all items are cancelled -- mark the item as cancelled
Map<String, Object> statusCtx = UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId"), "statusId", itemStatus, "userLogin", userLogin);
Map<String, Object> statusCtx = UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId"), "statusId", itemStatus, "changeReason", reasonEnumId, "userLogin", userLogin);
try {
dispatcher.runSyncIgnore("changeOrderItemStatus", statusCtx);
} catch (GenericServiceException e) {
@@ -2215,6 +2215,7 @@ public class OrderServices {
String orderId = (String) context.get("orderId");
String orderItemSeqId = (String) context.get("orderItemSeqId");
String fromStatusId = (String) context.get("fromStatusId");
String changeReason = (String) context.get("changeReason");
String statusId = (String) context.get("statusId");
Timestamp statusDateTime = (Timestamp) context.get("statusDateTime");
Locale locale = (Locale) context.get("locale");
@@ -2290,6 +2291,7 @@ public class OrderServices {
changeFields.put("statusId", statusId);
changeFields.put("orderId", orderId);
changeFields.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
changeFields.put("changeReason", changeReason);
changeFields.put("statusDatetime", statusDateTime);
changeFields.put("statusUserLogin", userLogin.getString("userLoginId"));
GenericValue orderStatus = delegator.makeValue("OrderStatus", changeFields);
File diff suppressed because it is too large Load Diff
@@ -1422,6 +1422,10 @@ under the License.
<description>Expire a FacilityLocationGeoPoint record</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
<service name="deleteFacilityLocationGeoPoint" default-entity-name="FacilityLocationGeoPoint" engine="entity-auto" invoke="delete" auth="true">
<description>Delete a FacilityLocationGeoPoint record</description>
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
<!-- InventoryItemType services -->
<service name="createInventoryItemType" engine="entity-auto" default-entity-name="InventoryItemType" invoke="create" auth="true">
+4 -3
View File
@@ -171,8 +171,9 @@ dependencies {
compile 'org.apache.httpcomponents:httpclient-cache:4.5.4'
compile 'org.apache.logging.log4j:log4j-api:2.10.0' // the API of log4j 2
compile 'org.apache.shiro:shiro-core:1.4.0'
compile 'org.apache.tika:tika-core:1.24.1'
compile 'org.apache.tika:tika-parsers:1.24.1'
compile 'org.apache.tika:tika-core:1.26'
compile 'org.apache.tika:tika-parsers:1.26'
compile 'org.apache.pdfbox:pdfbox:2.0.23'
compile 'org.apache.poi:poi:3.17'
compile 'org.apache.tomcat:tomcat-catalina-ha:9.0.43'
compile 'org.apache.tomcat:tomcat-catalina:9.0.43'
@@ -182,7 +183,7 @@ dependencies {
compile 'org.apache.xmlrpc:xmlrpc-client:3.1.3'
compile 'org.apache.xmlrpc:xmlrpc-server:3.1.3'
compile 'org.codehaus.groovy:groovy-all:2.4.13' // Remember to change the version number in javadoc.options block
compile 'org.freemarker:freemarker:2.3.28' // Remember to change the version number in FreeMarkerWorker class when upgrading
compile 'org.freemarker:freemarker:2.3.31' // Remember to change the version number in FreeMarkerWorker class when upgrading
compile 'org.hamcrest:hamcrest-all:1.3'
compile 'org.owasp.esapi:esapi:2.1.0.1'
compile 'org.springframework:spring-test:5.0.2.RELEASE'
@@ -17,13 +17,18 @@
# under the License.
###############################################################################
# Because of OFBIZ-10837 - Improve ObjectInputStream class.
# If you encounter a related issue (object not in the whitelist),
# you must provide a complete list of objects to pass to ObjectInputStream
# through ListOfSafeObjectsForInputStream property
# As an example, the a complete list of objects used by OFBiz OOTB is here.
# Because of OFBIZ-10837 "Improve ObjectInputStream class."
# If you encounter a related issue (object not in the allowList),
# you must provide a complete list of objects to pass to ObjectInputStream through allowList property
# As an example, the a complete list of objects used by OFBiz OOTB is here in allowList.
# You will need to add your objects/classes to this list.
# OFBiz committers: don't forget to add newobjects in SafeObjectInputStream class too (as default there).
# OFBiz committers:
# . don't forget to add new objects in SafeObjectInputStream class too (as default there).
# . "foo" and "SerializationInjector" are used in OFBiz tests
listOfSafeObjectsForInputStream=byte\\\\[\\\\], foo, SerializationInjector, \\\\[Z,\\\\[B,\\\\[S,\\\\[I,\\\\[J,\\\\[F,\\\\[D,\\\\[C, java..*, sun.util.calendar..*, org.apache.ofbiz..*, org.codehaus.groovy.runtime.GStringImpl, groovy.lang.GString
allowList=byte\\[\\], foo, SerializationInjector, \\[Z,\\[B,\\[S,\\[I,\\[J,\\[F,\\[D,\\[C, java..*, sun.util.calendar..*, org.apache.ofbiz..*, org.codehaus.groovy.runtime.GStringImpl, groovy.lang.GString
#-- List of strings rejected for serialisation
#-- The same comments than for allowList apply to denyList
denyList=rmi, <
@@ -24,6 +24,7 @@ import static org.apache.ofbiz.base.util.UtilProperties.getPropertyValue;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.util.Arrays;
@@ -36,26 +37,26 @@ import java.util.regex.Pattern;
* only authorized class can be read from it.
*/
public final class SafeObjectInputStream extends ObjectInputStream {
private static final String[] DEFAULT_WHITELIST_PATTERN = {
private static final String[] DEFAULT_ALLOWLIST_PATTERN = {
"byte\\[\\]", "foo", "SerializationInjector",
"\\[Z", "\\[B", "\\[S", "\\[I", "\\[J", "\\[F", "\\[D", "\\[C",
"java..*", "sun.util.calendar..*", "org.apache.ofbiz..*",
"org.codehaus.groovy.runtime.GStringImpl", "groovy.lang.GString"};
private static final String[] DEFAULT_DENYLIST = { "rmi", "<" };
/** The regular expression used to match serialized types. */
private final Pattern whitelistPattern;
private final Pattern allowlistPattern;
/**
* Instantiates a safe object input stream.
*
* @param in the input stream to read
* @throws IOException when reading is not possible.
*/
public SafeObjectInputStream(InputStream in) throws IOException {
super(in);
String safeObjectsProp = getPropertyValue("SafeObjectInputStream", "ListOfSafeObjectsForInputStream", "");
String[] whitelist = safeObjectsProp.isEmpty() ? DEFAULT_WHITELIST_PATTERN : safeObjectsProp.split(",");
whitelistPattern = Arrays.stream(whitelist)
String allowListProp = getPropertyValue("SafeObjectInputStream", "allowList", "");
String[] allowList = allowListProp.isEmpty() ? DEFAULT_ALLOWLIST_PATTERN : allowListProp.split(",");
allowlistPattern = Arrays.stream(allowList)
.map(String::trim)
.filter(str -> !str.isEmpty())
.collect(collectingAndThen(joining("|", "(", ")"), Pattern::compile));
@@ -64,21 +65,17 @@ public final class SafeObjectInputStream extends ObjectInputStream {
@Override
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
String className = classDesc.getName();
// BlackList exploits; eg: don't allow RMI here
if (className.contains("java.rmi.server")) {
Debug.logWarning("***Incompatible class***: "
+ classDesc.getName()
+ ". java.rmi.server classes are not allowed for security reason",
"SafeObjectInputStream");
return null;
}
if (!whitelistPattern.matcher(className).find()) {
// DiskFileItem, FileItemHeadersImpl are not serializable.
if (className.contains("org.apache.commons.fileupload")) {
return null;
// DenyList
String rejectedObjectsProp = getPropertyValue("security", "denyList", "");
String[] denyList = rejectedObjectsProp.isEmpty() ? DEFAULT_DENYLIST : rejectedObjectsProp.split(",");
// For now DEFAULT_DENYLIST: don't allow RMI, prevent generics markup in string type names
for (String deny : denyList) {
if (className.contains(deny)) {
throw new InvalidClassException(className, "Unauthorized deserialisation attempt");
}
Debug.logWarning("***Incompatible class***: "
+ classDesc.getName()
}
if (!allowlistPattern.matcher(className).find()) {
Debug.logWarning("***Incompatible class***: " + className
+ ". Please see OFBIZ-10837. Report to dev ML if you use OFBiz without changes. "
+ "Else follow https://s.apache.org/45war",
"SafeObjectInputStream");
@@ -93,12 +93,11 @@ public final class UtilObject {
Object obj = null;
try {
obj = getObjectException(bytes);
// DiskFileItem, FileItemHeadersImpl are not serializable. So SafeObjectInputStream::resolveClass return null
if (obj == null) {
return null;
}
} catch (ClassNotFoundException | IOException e) {
} catch (IOException e) {
Debug.logError(e, module);
} catch (ClassNotFoundException e1) {
// DiskFileItem, FileItemHeadersImpl are not serializable. So SafeObjectInputStream::resolveClass return ClassNotFoundException
return null;
}
return obj;
}
@@ -71,7 +71,7 @@ public final class FreeMarkerWorker {
public static final String module = FreeMarkerWorker.class.getName();
public static final Version version = Configuration.VERSION_2_3_28;
public static final Version version = Configuration.VERSION_2_3_31;
private FreeMarkerWorker () {}
+10 -10
View File
@@ -775,24 +775,24 @@
<value xml:lang="zh-TW">SecurityViewPermissionError 你沒有權限檢視本頁面. (需要"SECURITY_VIEW" 或 "SECURITY_ADMIN")</value>
</property>
<property key="SupportedFileFormatsIncludingSvg">
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), SVG, PDF, and ZIP or text files with safe contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers SVG, PDF, et les fichiers ZIP ou texte aux contenus sûrs sont acceptés.</value>
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), SVG, PDF, and ZIP or text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers SVG, PDF, et les fichiers ZIP ou texte avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) et aux contenus sûrs sont acceptés.</value>
</property>
<property key="SupportedFileFormats">
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), PDF or text files with safe contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers PDF ou les fichiers texte aux contenus sûrs sont acceptés.</value>
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), PDF or text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers PDF ou les fichiers texte avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) et aux contenus sûrs sont acceptés.</value>
</property>
<property key="SupportedImageFormatsIncludingSvg">
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), or SVG format are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) ou au format SVG sont acceptés.</value>
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), or SVG format with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) ou au format SVG avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés.</value>
</property>
<property key="SupportedImageFormats">
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF) are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) sont acceptés.</value>
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF) with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés.</value>
</property>
<property key="SupportedTextFileFormats">
<value xml:lang="en">For security reason only text files with safe contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers texte dont les contenus sont sûrs sont acceptés.</value>
<value xml:lang="en">For security reason only text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers texte dont les contenus et les noms sont sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés</value>
</property>
<property key="UserLogin">
<value xml:lang="de">Benutzeranmeldung</value>
+19 -19
View File
@@ -71,13 +71,13 @@ under the License.
<service name="groupTest" engine="group" location="testGroup" invoke=""/>
<service name="testHttp" engine="http" location="main-http" invoke="testScv">
<!-- <service name="testHttp" engine="http" location="main-http" invoke="testScv">
<description>HTTP service wrapper around the test service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
</service> -->
<service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
<!-- <service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
<description>SOAP service; calls the OFBiz test SOAP service</description>
<implements service="testSOAPScv"/>
</service>
@@ -87,12 +87,12 @@ under the License.
<implements service="testScv"/>
</service>
<!-- test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
It's redirected from https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService by the HTTPD frontend installed by Puppet in the demo server, ie ofbiz-vm2.apache.org
We could use also http://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService but HSTS would sent it to https anyway
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet -->
<service name="testRemoteSoap" engine="soap" export="true"
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet
<service name="testRemoteSoap" engine="soap" export="true"
location="https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService"
invoke="testSoapSimple">
<attribute name="defaultValue" type="Double" mode="IN" default-value="999.9999"/>
@@ -100,12 +100,12 @@ under the License.
<attribute name="resp" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, the 4 remote SOAP services below don't work -->
FIXME For now, not sure why, the 4 remote SOAP services below don't work
<!-- the location = endpoint = SOAP action -->
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListZipCode -->
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
the location = endpoint = SOAP action
invoke parameter is the name of the operation to invoke, for example LatLonListZipCode
invoke parameter is needed when there are several possible operations for the SOAP action
FIXME For now, not sure why, this remote SOAP service does not work
<service name="testRemoteSoap1" engine="soap" export="true"
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
invoke="LatLonListZipCode">
@@ -118,10 +118,10 @@ under the License.
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- the location = endpoint = SOAP action -->
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListCityNames -->
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
the location = endpoint = SOAP action
invoke parameter is the name of the operation to invoke, for example LatLonListCityNames
invoke parameter is needed when there are several possible operations for the SOAP action
FIXME For now, not sure why, this remote SOAP service does not work
<service name="testRemoteSoap2" engine="soap" export="true"
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
invoke="LatLonListCityNames">
@@ -134,7 +134,7 @@ under the License.
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
FIXME For now, not sure why, this remote SOAP service does not work
<service name="testRemoteSoap3" engine="soap" export="true"
location="http://www.restfulwebservices.net/wcf/EmailValidationService.svc"
invoke="EmailValidationService">
@@ -143,13 +143,13 @@ under the License.
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
FIXME For now, not sure why, this remote SOAP service does not work
<service name="testRemoteSoap4" engine="soap" export="true"
location="http://www.webservicex.net/geoipservice.asmx"
invoke="GetGeoIPContext">
<attribute name="invoke" type="String" mode="IN" />
<attribute name="result" type="String" mode="OUT"/>
</service>
</service> -->
<service name="testGroovy" engine="groovy" location="component://common/minilang/GroovyServiceTest.groovy" invoke="">
<description>Test Groovy Script Service</description>
@@ -24,7 +24,7 @@ under the License.
<!-- event handlers -->
<handler name="java" type="request" class="org.apache.ofbiz.webapp.event.JavaEventHandler"/>
<handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/>
<!-- <handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/> -->
<handler name="xmlrpc" type="request" class="org.apache.ofbiz.webapp.event.XmlRpcEventHandler"/>
<handler name="service" type="request" class="org.apache.ofbiz.webapp.event.ServiceEventHandler"/>
<handler name="service-multi" type="request" class="org.apache.ofbiz.webapp.event.ServiceMultiEventHandler"/>
@@ -105,32 +105,43 @@ public class SecuredUpload {
return true;
}
String imageServerUrl = EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator);
Path p = Paths.get(fileToCheck);
String file = p.getFileName().toString();
boolean wrongFile = true;
if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) {
if (fileToCheck.length() > 259) {
Debug.logError("Uploaded file name too long", MODULE);
return false;
} else if (!file.matches("[a-zA-Z0-9]{1,249}.[a-zA-Z0-9]{1,10}")) {
Debug.logError("Uploaded file "
+ " should contain only Alpha-Numeric characters, only 1 dot as an input for the file name and the extension."
+ "The file name and the extension should not be empty at all",
MODULE);
return false;
} else if (p.toString().contains(imageServerUrl.replaceAll("/", "\\\\"))) {
if (file.matches("[a-zA-Z0-9-_ ()]{1,249}.[a-zA-Z0-9-_ ]{1,10}")) { // "(" and ")" for duplicates files
wrongFile = false;
}
} else if (file.matches("[a-zA-Z0-9-_ ]{1,249}.[a-zA-Z0-9-_ ]{1,10}")) {
wrongFile = false;
}
} else {
} else { // Suppose a *nix system
if (fileToCheck.length() > 4096) {
Debug.logError("Uploaded file name too long", MODULE);
return false;
} else if (!file.matches("[a-zA-Z0-9]{1,4086}.[a-zA-Z0-9]{1,10}")) {
Debug.logError("Uploaded file "
+ " should contain only Alpha-Numeric characters, only 1 dot as an input for the file name and the extension."
+ "Tthe file name and the extension should not be empty at all",
MODULE);
return false;
} else if (p.toString().contains(imageServerUrl)) {
if (file.matches("[a-zA-Z0-9-_ ()]{1,4086}.[a-zA-Z0-9-_ ]{1,10}")) { // "(" and ")" for duplicates files
wrongFile = false;
}
} else if (file.matches("[a-zA-Z0-9-_ ]{1,4086}.[a-zA-Z0-9-_ ]{1,10}")) {
wrongFile = false;
}
}
if (wrongFile) {
Debug.logError("Uploaded file "
+ " should contain only Alpha-Numeric characters, hyphen, underscore and spaces,"
+ " only 1 dot as an input for the file name and the extension."
+ "The file name and extension should not be empty at all",
MODULE);
return false;
}
if (isExecutable(fileToCheck)) {
return false;
}
@@ -217,10 +228,10 @@ public class SecuredUpload {
Path filePath = Paths.get(fileName);
byte[] bytesFromFile = Files.readAllBytes(filePath);
ImageFormat imageFormat = Imaging.guessFormat(bytesFromFile);
return imageFormat.equals(ImageFormats.PNG)
return (imageFormat.equals(ImageFormats.PNG)
|| imageFormat.equals(ImageFormats.GIF)
|| imageFormat.equals(ImageFormats.TIFF)
|| imageFormat.equals(ImageFormats.JPEG)
|| imageFormat.equals(ImageFormats.JPEG))
&& imageMadeSafe(fileName);
}
+6 -6
View File
@@ -52,10 +52,10 @@ under the License.
<engine name="javascript" class="org.apache.ofbiz.service.engine.ScriptEngine"/>
<!-- -->
<engine name="route" class="org.apache.ofbiz.service.engine.RouteEngine"/>
<engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/>
<!-- <engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/> -->
<engine name="jms" class="org.apache.ofbiz.service.jms.JmsServiceEngine"/>
<engine name="rmi" class="org.apache.ofbiz.service.rmi.RmiServiceEngine"/>
<engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/>
<!-- <engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/> -->
<!-- The engine xml-rpc-local is only used by a test service and for this reason it is configured to run on port 8080.
In order to use this in OFBiz change the port accordingly (for demo the default value is 8080)
-->
@@ -66,14 +66,14 @@ under the License.
</engine>
<service-location name="main-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
<service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/>
<!-- <service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/> -->
<service-location name="entity-sync-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
<service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/>
<!-- <service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/> -->
<service-location name="rita-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
<service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/>
<!-- <service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/> -->
<!-- default notification group for all services loaded with 'main' loader
- uncomment this to enable error notification for all services
+1 -1
View File
@@ -22,7 +22,7 @@ under the License.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="service-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEngineTests"/></test-case>
<test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case>
<!-- <test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case> -->
<test-case case-name="service-entity-auto-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEntityAutoTests"/></test-case>
<test-case case-name="load-service-test-data">
@@ -43,7 +43,8 @@ under the License.
<!-- Request Mappings -->
<!-- Begin Utility Requests -->
<request-map uri="httpService">
<!-- The 2 services below have been commented out for security reason, see OFBIZ-12212 -->
<!-- <request-map uri="httpService">
<event type="java" path="org.apache.ofbiz.service.engine.HttpEngine" invoke="httpEngine"/>
<response name="success" type="none"/>
<response name="error" type="none"/>
@@ -53,7 +54,7 @@ under the License.
<event type="soap"/>
<response name="error" type="none"/>
<response name="success" type="none"/>
</request-map>
</request-map> -->
<request-map uri="xmlrpc" track-serverhit="false" track-visit="false">
<security auth="true"/>
<event type="xmlrpc"/>
+8
View File
@@ -25,6 +25,14 @@ If ($ExecutionContext.SessionState.LanguageMode -eq "ConstrainedLanguage") {
Invoke-WebRequest -outf gradle\wrapper\gradle-wrapper.jar https://github.com/gradle/gradle/raw/v4.5.1/gradle/wrapper/gradle-wrapper.jar
}
$expected = "00d0743607178962f8b120da4ccad2c64c698aec"
$actual = (Get-FileHash gradle\wrapper\gradle-wrapper.jar -Algorithm SHA1).Hash.ToLower()
@{$true = 'OK: Checksum match'; $false = "ERROR: Checksum mismatch!`nExpected: $expected`nActual: $actual"}[$actual -eq $expected]
if (!$true) {
Remove-Item gradle\wrapper\gradle-wrapper.jar
}
#Write-Host $ExecutionContext.SessionState.LanguageMode
Start-Sleep -s 3