(OFBIZ-11477)
According to OWASP OFBiz Web Content Caching is weak:
Independently of the cache policy defined by the web application, if caching web
application contents is allowed, the session IDs must never be cached, so it is
highly recommended to use the Cache-Control: no-cache="Set-Cookie, Set-Cookie2"
directive, to allow web clients to cache everything except the session ID
I though noticed that Set-Cookie2 is deprecated for a long time now. And we new
browsers policies it to often updated. So no need to use Set-Cookie2.
(OFBIZ-11317)
In some place, like at least themes/tomahawk/template/AppBarClose.ftl the CSRF
token is not generated. Because in those places OfbizUrlTransform is used.
An immediate solution is to add the CSRF token generation in OfbizUrlTransform
class.
A definitive solution is to complete OFBIZ-11229
"Merge UrlRegexpTransform and OfbizUrlTransform classes"
(OFBIZ-11317)
Adding the controlPath attribute to allow the controls by ofbizUrl to support uri to other OFBiz web application.
Thanks: Jacques for the review
(OFBIZ-11313)
‘RequestHandler#ControllerConfig’ was a wrapper around
‘ConfigXMLReader#ControllerConfig’ used as a convenience to gather
error handling when accessing configuration properties. Since the
later is now only throwing exceptions when instantiating the object,
‘RequestHandler#ControllerConfig’ is not useful anymore.
(OFBIZ-11313)
The included controller files resolution was previously delayed when
accessing the configuration properties. The issue is that it imposes
callers to handle exceptions when accessing those
properties. Additionally this has the drawback of detecting inclusion
issues late.
We are now retrieving the included files when instantiating the
controller configuration object. This provides more guarantee on the
integrity of instantiated controllers and relax the error handling
requirements on configuration properties callers.
(OFBIZ-11161)
All files in {compoment}/config directories are placed in jar
root (cf. sourceSets definition in build.gradle) but there are 4 different
`freemarkerTransforms.properties` in ofbiz (content, product, webapp, widget).
This works fine because we are adding config directories in classpath (through
classpath tag in ofbiz-component.xml), but this is not really intuitive. So to
make things clearer this patch move `freemarkerTransforms.properties` into
`src/main/resources` with a namespace package and `FreeMarkerWorker.java` is
modified accordingly.
We currently have two ways to define component loading order. Either
by using ‘depends-on’ attribute in “component-config.xml” or by adding
a “component-load.xml” file at the root of a component directory.
“depends-on” is more flexible because it handles partial ordering when
“component-load.xml” defines a total order which is not necessarily
meaningful, so it is better to rely only “depends-on”.
This removes the usage of “component-load.xml” to use ‘depends-on’
instead. The dependency declarations correspond to the total ordering
previously defined but will need to be refined in the future to relax
unnecessary dependency declarations.
Only “framework/base/config/component-load.xml” which defines the
top-level directories order (framework, applications, themes and
plugins) is kept.
(OFBIZ-11260)
There is no security reason justifying to prevent the invocation of
service event handlers with URI parameters if we accept request body
parameters. As a consequence it is preferable to unconditionally
accept URI parameters and remove the
‘service.http.parameters.require.encrypted’ configuration property.
(OFBIZ-11259)
This was broken by r1839451 committed at the bottom of OFBIZ-10438
A simple fix is to allow "webtools/control/SOAPService/serviceName?WSDL" scheme.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869155 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11007)
It is now possible to use segmented paths by using URI templates like
‘/foo/bar/{baz}’ in the ‘uri’ attribute of <request-map> elements.
Thanks: Artemiy Rozovyk for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868963 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10284)
The XMLRPC service does not support tenants. Even if the tenant domain is
included in the HTTP request the call does not affect the correct tenant.
The issue and fix has been discussed in in the thread
https://markmail.org/message/bz4dofrxqp6i7ove
jleroux: I was able to port the R16 patch provided by Rajesh to the trunk.
Thanks: Rajesh Kumar Mallah
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868611 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11123)
I found that using in r1866259 the same fix than Si Chen used in OFBIZ-750 was
wrong. The code just above this fix is
{code:java}
if (obj instanceof Serializable) {
reqAttrMap.put(name, obj);
}
{code}
The problem with this code is that if does not handle inner Maps which may
contain a non Serializable Object. So the solution is rather to get one level
deeper and apply the same. We can then remove the harcoded lines with
"uploadedFile" and "_REQUEST_HANDLER_" below. Then all possible cases are handled
as long as we have not inner-inner-Maps
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868298 13f79535-47bb-0310-9956-ffa450edef68
called directly.
(OFBIZ-11199)
I suppose this issue is similar to OFBIZ-11152. So I'm handling it the same.
It's not an end to the underneath issue but at least it can reassure user about
things being handled...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866855 13f79535-47bb-0310-9956-ffa450edef68
(including admin) via "Forget Your Password"
(OFBIZ-4361)
Currently, any user (via ecommerce "Forget Your Password") has the ability to
reset another users password, including "admin" without permission.
By simply entering "admin" and clicking "Email Password", the following is
displayed:
The following occurred:
A new password has been created and sent to you. Please check your Email.
This now forces the user of the ERP to change their password.
It is also possible to generate a dictionary attack against ofbiz because there
is no capta code required. This is serious security risk.
I have modified the patch following comments I made in the Jira, notably
Removed unused Java variables
Removed a check in LoginEvents::forgotPassword which prevented to show error
messages
Changed fr and en SecurityExtPasswordSentToYou
+ SecurityExtThisEmailIsInResponseToYourRequestToHave labels
+ template PasswordEmail.ftl
+ loginservices.token_incorrect labels
Added fr and en SecurityExtIgnoreEmail + SecurityExtLinkOnce labels
Removed changes in general.properties
I did not remove the 2 GetSecurityQuestion.ftl files (webpos one was still in)
There is still room for improvement. I'll discuss them on the Jira and dev
ML. But this version is already strong enough to not wait that the patch is
inapplicable!
Thanks: mz4wheeler (Mike Z) for the Jira, Nicolas Malin for the patch, I guess
with some Gil's help, and all others for comments and ideas
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866478 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11123)
In a lot of services we use the ByteBuffer object to upload files.
When a such service is used with the redirect-parameter in a controller the
ByteBuffer needs to be serialized. Unfortunately ByteBuffer (in our case its
subclass HeapByteBuffer) is not serializable. So that can't work.
Fortunately no redirect-parameter concerns uploadedFile so we can safely remove
it from reqAttrMap in RequestHandler
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866259 13f79535-47bb-0310-9956-ffa450edef68
called directly.
(OFBIZ-11152)
Gives an advice to reassure users about the seriousness of the issue
This issue can be easily reproduced by going to example/control/FormWidgetExamples
Other backend components are less concerned but it happens sometimes in them too.
It's quite hard to understand what's happening.
This is a sequel of OFBIZ-10895
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866255 13f79535-47bb-0310-9956-ffa450edef68
in log
(OFBIZ-11154)
An error appears in log due to the nested request that can not be resolved
properly.
We should not worry about nested requests, they continue to work, and we should
simply not show an error message from RequestHandler in case of nested request.
Thanks: Initialy spotted by Benjamin Jugl in OFBIZ-9379
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865902 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11161)
the "dtd" directories are already present as resources distributed
inside OFBiz jar, so there is no need to augment the classpath to find
the XML schema inside those directories.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865796 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7532)
To display a number we had different possibilities :
* on ftl use the template <@ofbizAmount and <@ofbizCurrency
* by java call a function UtilFormatOut.formatAmount, UtilFormatOut.formatPrice, UtilFormatOut.formatQuantity, etc..
* by form widget, use <display type=accounting-number for accounting but nothing for other
To simplify and homogenize all, I implemented a number type purpose :
* default: display a number by default, use when no purpose is present
* quantity: display a number as a quantity
* amount: display a number as an amount (like price without currency)
* spelled: litteral displaying for a number (use on <@ofbizAmount ftl only before)
* percentage: display a number as a percentage
* accounting: diplay a number for accounting specific
Each purpose can be associate to a number for displaying it :
* on ftl <@ofbizNumber number=value format=purpose/>
* on java UtilFormatOut.formatNumber(value, purpose, delegator, locale)
* on form widget <display type=number format=purpose/>
The format use by a purpose is define on framework/common/config/number.properties with the template
.displaying.format = ##0.00
With this, you can surchage a configuration, create your own purpose or surchage only one through entity SystemProperty.
Concerning the backware compatibility:
* For the ftl the template <@ofbizAmount is now a link to '<@ofbizNumber format=amount'
* For java all previous function call UtilFormatOut.formatNumber with the matching purpose
* For form xml accounting-number is managed as an exection
Last point, display a currency is different that a number, so I didn't refactoring some code for this case (only move properties from general to number for centralize de configuration on the same file)
Thanks Charles Steltzlen to start the refactoring
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1864832 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11138)
Use ‘LocalDateTime’ instead of ‘Calendar’ and
‘HttpServletRequest#getParameterMap’ instead of
‘HttpServletRequest#getParameterNames’.
The tests and callers has been adapted to remove the ‘locale’ arguments which
made sense only for ‘Calendar’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863439 13f79535-47bb-0310-9956-ffa450edef68
It is better to avoid using obsolete ‘Enumeration’ class when possible
so the calls to ‘HttpServletRequest#getParameterNames’ has been
replaced by ‘HttpServletRequest#getParameterMap’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863404 13f79535-47bb-0310-9956-ffa450edef68