Backport 2aa68dc4de from trunk
When you have a user with long password (greater than 256 characters) present in OFBiz and you try to log with, OFBiz return a long error message with sensitive information due to exceeding value size to store on the field UserLoginHistory.passwordUsed.
To solve this we don't return any information on the genericValue that failed and analyze the field passwordUsed to escape the case where the password set to login is create than the database field capacity.
Thanks to Daniel Elkabes <daniel.elkabes@whitesourcesoftware.com> and Hagai Wechsler <hagai.wechsler@whitesourcesoftware.com> from white source software to raise the problem.
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
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
In https://markmail.org/message/pf3d3qyjfucicbj7 I initially answered:
In demo data 13 parties use <<infoString="ofbiztest@example.com">> as in
<ContactMech contactMechId="FRA01" contactMechTypeId="EMAIL_ADDRESS" infoString="ofbiztest@example.com"/>
This one is loaded last. Rather
<ContactMech contactMechId="Company" contactMechTypeId="EMAIL_ADDRESS" infoString="ofbiztest@example.com"/>
which is the 1st one, should be loaded last.
A better solution is to use "ofbizsupport@example.com" in EmailServices.xml
Indeed, fortunately the Company party also uses this infoString and using it in
EmailServices.xml does not affect the integration test and should not affect
other parts of the (only) demo data
Thanks: Emad Radwan for opiniated report :) and Pritam Kute for issue analysis
2020/08/10 the OFBiz security team received a security report by Harshit Shukla
<harshit.shukz@gmail.com>, roughly it was (quoting part of it to simplify):
<<I have identified a Remote Code Execution (RCE) Vulnerability. The reason
behind this RCE is lack of file extension check at
catalog/control/UploadCategoryImage?productCategoryId=CATALOG1_BEST_SELL&pload_file_type=category>>
Using this post-auth RCE in OFBiz demos, Harshit was able to get some AWS
credentials by uploading a webshell (based on [0]).
By security, it was then decided by the Infra and OFBiz security teams to shut
down the demos.
After discussing the elements reported with Mark J Cox (VP of ASF security team)
we in common decided that no CVE was necessary.
# Conflicts handled by hand in R18:
# applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
# applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
# applications/product/groovyScripts/catalog/category/EditCategory.groovy
# applications/product/groovyScripts/catalog/config/EditProductConfigItemContent.groovy
# applications/product/groovyScripts/catalog/imagemanagement/ImageUpload.groovy
# applications/product/groovyScripts/catalog/imagemanagement/SetDefaultImage.groovy
# applications/product/groovyScripts/catalog/product/EditProductContent.groovy
# applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java
# applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
# applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
# applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
# build.gradle
# framework/base/src/main/java/org/apache/ofbiz/base/util/FileUtil.java
# framework/base/src/main/java/org/apache/ofbiz/base/util/HttpRequestFileUpload.java
# framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
# framework/security/config/security.properties
# Conflicts handled by hand in R17:
# applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
# applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
# applications/datamodel/data/seed/ContentSeedData.xml
# build.gradle
# framework/base/src/main/java/org/apache/ofbiz/base/util/HttpRequestFileUpload.java
(OFBIZ-11633)
When you upload a content from the party profile page you don't see a progress
bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong
Mohammad Kathawala mentionned that it was removed with OFBIZ-9299
It was also broken with OFBIZ-11402
Thanks: Mohammad for the track
Conflicts handled by hand
applications/party/template/party/profileblocks/Content.ftl
framework/common/groovyScripts/CommonServices.groovy
(OFBIZ-11329)
This will be notably useful when committing CSRF solution as explained in
OFBIZ-11306:
SetTimeZoneFromBrowser when starting gives a RequestHandlerException:
Invalid or missing CSRF token for AJAX call to path '/SetTimeZoneFromBrowser'.
Also not only when starting.
Thanks: James Yong for review
(cherry picked from commit 350c71f4df)
# Conflicts:
# framework/common/groovyScripts/SetLocaleFromBrowser.groovy
# themes/common-theme/webapp/common/js/util/setUserTimeZone.js replaced
by setUserLocale.js modified by hand
I can compile locally but I can see a reason why and certainly not related to
these changes
(OFBIZ-5409)
I reopended this old issue because, while working on OFBIZ-11329, I found that
userLogin and impersonateLogin should be removed from
jsonResponseFromRequestAttributes
Thanks: James Yong for pointing that out
# Conflicts:
# framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
(OFBIZ-10753)
When OFBiz raise an error, the framework use a jsp page to display it.
I improved the error page generation to support also ftl template rendering and by this way extend the theme engine to support to overide it
On controler.xml we can now use :
<errorpage>/error/error.jsp</errorpage>
or
<errorpage>component://common/webcommon/error/Error.ftl</errorpage> (default configuration)
On your theme you can add your own error page :
<template>
...
<template-file widget=menu location=component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl/>
+ <template-file widget=error location=component://common-theme/template/ErrorPage.ftl/>
</template>
The component://common/webcommon/error/Error.ftl contains the logic theming connection and to simplify source code, all framework old error page (error.jsp) have been removed to centralize all on this new page.
Thanks to Marine Desmarchelier for the error page design
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856175 13f79535-47bb-0310-9956-ffa450edef68
# Conflicts:
# framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java
# themes/common/template/ErrorPage.ftl
------------------------------------------------------------------------
r1865370 | jleroux | 2019-08-17 20:26:42 +0200 (sam. 17 août 2019) | 7 lignes
Improved: Use Labels in themes names
(OFBIZ-9863)
Adds labels and necessary calls in Theme.xml
While at it, improves other backend themes labels by removing redundancy, at
least in French and English.
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1865372 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1859877 | jleroux | 2019-05-24 15:47:08 +0200 (ven. 24 mai 2019) | 10 lignes
Fixed: Services allow arbitrary HTML for parameters with allow-html set to "safe"
(OFBIZ-5254)
This was reopened after discussion at
https://markmail.org/message/jnaitmwahjcjmdn5
This is a new solution which follows the work done with OFBIZ-6669 and OFBIZ-10187
Roughly said, it uses org.owasp.html.PolicyFactory and org.owasp.html.Sanitizers
Thanks: Christoph Neuroth for report
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1859879 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1859800 | jleroux | 2019-05-23 18:36:37 +0200 (jeu. 23 mai 2019) | 8 lignes
Fixed: Replace request-redirect w/ no redirect-param attribute by
request-redirect-noparam
(OFBIZ-9997)
Reverts all the rest from r1816180, and, after reading carefully the code used
for "request-redirect" in RequestHandler (and downward), fixes the documentation
in site-conf.xsd
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1859802 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1857099 | jleroux | 2019-04-08 11:17:55 +0200 (lun. 08 avr. 2019) | 12 lignes
Improved: Using try-with-resources with File IO Objects.
(OFBIZ-9855)
Uses try with resources for File IO objects like ObjectInputStream and other
objects. File classes have the AutoCloseable interface.
jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...
All tests pass
Thanks: Pradhan Yash Sharma
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1857487 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1856667 | jleroux | 2019-03-31 11:14:16 +0200 (dim. 31 mars 2019) | 10 lignes
Fixed: EmailServices.sendMail causes a NPE, when sendFrom is missing
(OFBIZ-10706)
I tried to find the history for why the service does not take the
defaultFromEmailAddress property from general.properties and I found that It was
last modified in revision r418498 on 02/07/2006, I think it was always broken.
This uses defaultFromEmailAddress property in sendMail if sendFrom is missing
Thanks: Benjanmin Jugl reported, Pawan Verma fixed and others for discussion
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1856669 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1854306 | jleroux | 2019-02-25 11:33:53 +0100 (lun. 25 févr. 2019) | 6 lignes
Improved: no functional change
A missing space before CommonBranch label made the word trunkbranch instead of
trunk branch.
I'll backport this
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1854308 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10460)
The setLocaleFromBrowser request map defined in common-controller.xml has an
attribute of auth=false
While the service associated with it in framework/common/servicedef/services.xml
has an attribute of auth=true.
jleroux: this was missing in the initial patch. At OFBIZ-9264 the description is
"it sets the time zone of the user logged in to it's browser time zone."
So being logged in seems needed, hence better to set auth=true everywhere
Thanks: as reported by Deepak in OFBIZ-10460 there is a problem with that.
So we need keep the inconsistence and the service protected.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1835616 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1835586 | jleroux | 2018-07-10 19:31:50 +0200 (mar. 10 juil. 2018) | 13 lignes
Fixed: setLocaleFromBrowser requires authentification
(OFBIZ-10460)
The setLocaleFromBrowser request map defined in common-controller.xml has an
attribute of auth=false
While the service associated with it in framework/common/servicedef/services.xml
has an attribute of auth=true.
jleroux: this was missing in the initial patch. At OFBIZ-9264 the description is
"it sets the time zone of the user logged in to it's browser time zone."
So being logged in seems needed, hence better to set auth=true everywhere
Thanks: Mathieu Lirzin for report
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1835587 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10458)
A new Junit test is implemented to validate that no duplicates are present.
Groovy service has been refactored to use a more functional style
Thanks Mathieu Lirzin for reporting and providing the patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1835283 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1831078 | jleroux | 2018-05-07 09:48:57 +0200 (lun. 07 mai 2018) | 6 lignes
Fixed: The "request" attribute type of the userLogin service is wrong
(OFBIZ-10304)
Now that we use Tomcat 9 this problem is over
Thanks: Jacopo for upgrading to Tomcat 9
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1831080 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1827439 | jleroux | 2018-03-21 21:53:41 +0100 (mer., 21 mars 2018) | 5 lines
Fixed: The "request" attribute type of the userLogin service is wrong
(OFBIZ-10304)
It should have been org.apache.catalina.connector.RequestFacade"
instead of javax.servlet.http.HttpServletRequest see the Jira for details
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1827440 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1823324 | jleroux | 2018-02-06 14:17:57 +0100 (mar., 06 févr. 2018) | 26 lines
Fixed: Security issue in Token Based Authentication
(OFBIZ-10206)
The version I committed so far in OFBIZ-9833 has a small security issue.
See the Jira description for all details
To test I have attached a OFBIZ-10206-external-server-test-example.patch to
the Jira
This removes the external-server-query property now useless
In ContextFilter the getHeader (wrapper) now uses an autoLoginCookie to get
the userLoginId passed in the JWT instead of externalServerUserLogin parameter.
A sourceServerWebappName parameter must be passed from the client request to
allow reading the autoLoginCookie.
This userLoginId is then retrieved on the target server from the JWT in the
externalServerLoginCheck which is simplified.
In LoginWorker
getAutoLoginCookieName() has now 2 versions to allow to pass a webappname
A new autoLogoutFromAllBackendSessions() method has been added but for now
commented out. Decommenting it out will be submitted as a patch in OFBIZ-4959.
Thanks: Leila Mekika for reporting the security issue directly to me
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1823325 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821386 | jleroux | 2018-01-17 16:28:51 +0100 (mer., 17 janv. 2018) | 9 lines
Improved: Make xssi prefix configurable
(OFBIZ-9169)
In OFBIZ-5409 a prefix was added for GET ajax requests.
It would be beneficial if the prefix could be configured instead of hard coded
jleroux: at r1777942 I missed the general.properties change
Thanks: Michael Brohl for reporting the issue
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1821387 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821219 | jleroux | 2018-01-16 08:58:49 +0100 (mar., 16 janv. 2018) | 8 lines
Improved: Update Geo information according to ISO notifications, Mali
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15836 and INFRA-15842,
so will be backported
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1821220 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821186 | jleroux | 2018-01-15 18:47:05 +0100 (lun., 15 janv. 2018) | 9 lines
Improved: Update Geo information according to ISO notifications, Moldova
(the Republic of)/
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15836, so will be backported
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1821187 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821144 | jleroux | 2018-01-15 11:45:33 +0100 (lun., 15 janv. 2018) | 9 lines
Improved: Update Geo information according to ISO notifications, Lao People's
Democratic Republic (the)
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15836, so will be backported
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1821149 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821112 | jleroux | 2018-01-14 19:23:57 +0100 (dim., 14 janv. 2018) | 9 lines
Improved: Update Geo information according to ISO notifications, Korea
(the Democratic People's Republic of)
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15836, so will be backported
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1821113 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1820644 | jleroux | 2018-01-09 12:30:39 +0100 (mar., 09 janv. 2018) | 8 lines
Improved: Update Geo information according to ISO notifications
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
Here are China, Germany, Hungary and Indonesia
This is mostly to check WIP at INFRA-15394, INFRA-15785 and OFBIZ-10147
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1820726 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1820441 | jleroux | 2018-01-07 11:51:39 +0100 (dim., 07 janv. 2018) | 8 lines
Improved: Update Geo information according to ISO notifications, Ecuador
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15394, INFRA-15785 and OFBIZ-10147
Thanks: Kyra Pritzel-Hentley
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1820443 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1820375 | jleroux | 2018-01-06 08:13:44 +0100 (sam., 06 janv. 2018) | 8 lines
Improved: Update Geo information according to ISO notifications, Iceland
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
This is mostly to check WIP at INFRA-15394, INFRA-15785 and OFBIZ-10147
Thanks: Kyra Pritzel-Hentley
Note: I backport this simple and harmless commit in order to test the new
ofbizBranch17Framework builder AGAIN!!!
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1820402 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1820374 | jleroux | 2018-01-06 07:01:15 +0100 (sam., 06 janv. 2018) | 6 lines
Improved: Update Geo information according to ISO notifications, Cyprus
(OFBIZ-10028)
This follows this discussion http://markmail.org/message/xn7f552qvtpua2uq
Thanks: Kyra Pritzel-Hentley
Note: I backport this simple and harmless commit in order to test the new
ofbizBranch17Framework builder
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1820386 13f79535-47bb-0310-9956-ffa450edef68