Commit Graph
948 Commits
Author SHA1 Message Date
Jacques Le Roux 2b15c0302c Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo
2021-07-20 07:35:11 +02:00
Jacques Le Roux 6dc266996e Fixed: NotSerializableException using uploadPartyContentFile service (OFBIZ-12050)
This error appears after trying to upload a file to party content:

2020-11-06 07:48:22,488 |jsse-nio-8443-exec-7 |RequestHandler                |I|
Sending redirect to:
[https://localhost:8443/partymgr/control/viewprofile?partyId=admin].
2020-11-06 07:48:29,288 |jsse-nio-8443-exec-7 |UtilObject                    |E|
null
java.io.NotSerializableException: org.apache.commons.fileupload.disk.DiskFileItem

# Conflicts handled by hand
#	framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
#	framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
2020-11-06 11:23:27 +01:00
Jacques Le Roux b7b7cad1a2 Fixed: MODULE is not module :/ (backporting is never easy!) 2020-07-11 11:20:28 +02:00
Jacques Le Roux 0e3b1c7a49 Improved: better message for host-headers-allowed
Adds an explanation about what to do when using own domain.

Some users don't look into the log so it's better to set also the exception
message in order for them to have it right at 1st glance.
2020-07-11 09:54:18 +02:00
Jacques Le Roux 27c91802fc Improved: Improve ObjectInputStream class
(OFBIZ-10837)

While working on OFBIZ-11633 I crossed an issue in R18 (not in trunk) where
objects from org.apache.commons.fileupload (namely DiskFileItem and
FileItemHeadersImpl) are not serializable.

While at it I decided to handle at the SafeObjectInputStream level
the "fileItems" case I already crossed with, OFBIZ-11534, in RequestHandler

It has an inconvenient in R18 (not in trunk) where ObjectInputStream can't
handle a null class (of course) and so return a benign exception in log (only).

I believe it's better to handle these specific cases at the lower possible
level in all supported branches.
2020-05-02 12:42:45 +02:00
Jacques Le Roux 9f5ebc48fd Fixed: Error in uploading very large files, ie >2MB
(OFBIZ-11534)

This was not supposed to be committed, actually (wrong) part of OFBIZ-11597

Fixed: Error in uploading very large files, ie >2MB

(OFBIZ-11534)

There is an issue in uploading large files, I am able to upload files up to 2 GB
successfully but getting an error when trying to upload a file larger than 2GB.

Example -
1. Go to party profile -
https://demo-trunk.ofbiz.apache.org/partymgr/control/viewprofile?partyId=admin
2. Try to create a party content with a file larger than 2 GB
3. Error on console

jleroux:
For a 2GB+ file you need to set Xmx to more than the double of the file size,
eg: gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx5048M"

You then get another small issue (only in log) when redirecting to send the
partyId parameter.

This is because, DiskFileItem is a temporary Object with a null value contained
in "fileItems" attribute. It can't be detected by UtilMisc::makeMapSerializable
and that makes "fileItems" not serializable. So it must be removed from
reqAttrMap.

Thanks: Chandan Khandelwal for report, Michael for suggesting a very large file
to upload
2020-04-16 16:16:14 +02:00
Jacques Le Roux 42ad34f0b6 Fixed: removes a wrong import due to CSRF token backport trying 2020-04-05 12:02:06 +02:00
Jacques Le Roux 793628bb15 Fixed: Prevent Host Header Injection (CVE-2019-12425)
(OFBIZ-11583)

Conflicts handled by hand
  framework/security/config/security.properties
  framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
2020-04-05 11:40:48 +02:00
Jacques Le Roux 84e102a6a1 Revert "Merge branch 'JacquesLeRoux-POC-for-CSRF-Token-OFBIZ-11306' into trunk"
This reverts commit 27e57522b1.
2020-04-05 10:05:16 +02:00
Jacques Le Roux 27e57522b1 Merge branch 'JacquesLeRoux-POC-for-CSRF-Token-OFBIZ-11306' into trunk
Because of GitHub message on PR56:
This branch cannot be rebased due to conflicts

Much Conflicts, but that should be OK
2020-04-04 18:41:14 +02:00
Jacques Le Roux 7e03082d92 Improved: Improve Web Content Caching
(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.
2020-03-27 10:11:53 +01:00
Jacques Le Roux 1617226897 Fixed: Ensure that the SameSite attribute is set to 'strict' for all cookies.
(OFBIZ-11470)

It's better to allow users to change from strict to lax, at least for all
cookies. Some could want to change it by cookie type. I let the exercise for
them :)
See:https://blog.mozilla.org/security/2018/04/24/same-site-cookies-in-firefox-60

Conflicts handled by hand
	framework/security/config/security.properties
2020-03-21 11:59:46 +01:00
Jacques Le Roux 09270a1c34 Fixed: Ensure that the SameSite attribute is set to 'strict' for all cookies.
(OFBIZ-11470)

Forgot to add UtilHttp::SameSiteFilter
2020-03-20 18:05:39 +01:00
Nicolas Malin 9b9db9e511 Improved: Improve error message page to support Theming
(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
2020-02-01 11:08:21 +01:00
Samuel Trégouët 6facc0e73d Fixed: Use ‘WebAppUtil#parseWebXmlFile’ when handling “web.xml” files
(OFBIZ-6993)

# Conflict handled by hand in:
#	framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
2019-12-19 08:47:13 +01:00
Mathieu Lirzin 3cd7a3e9e9 Fixed: Display file name in XML parsing errors
(OFBIZ-6993)
2019-12-19 06:52:55 +01:00
Jacques Le Roux bf2644babd "Applied fix from trunk for revision: 1868611"
------------------------------------------------------------------------
r1868611 | jleroux | 2019-10-19 08:42:07 +0200 (sam. 19 oct. 2019) | 11 lignes

Improved: Handling tenant in XmlRpcEventHandler
(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/branches/release17.12@1868613 13f79535-47bb-0310-9956-ffa450edef68
2019-10-19 06:58:10 +00:00
Jacques Le Roux 12d96cebe9 "Applied fix from trunk for revision: 1868298"
------------------------------------------------------------------------
r1868298 | jleroux | 2019-10-11 18:45:16 +0200 (ven. 11 oct. 2019) | 20 lignes

Fixed: NotSerializableException after uploading images to an order
(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/branches/release17.12@1868300 13f79535-47bb-0310-9956-ffa450edef68
2019-10-11 16:45:58 +00:00
Jacques Le Roux f421e7ced4 "Applied fix from trunk for revision: 1866259"
------------------------------------------------------------------------
r1866259 | jleroux | 2019-09-02 09:32:48 +0200 (lun. 02 sept. 2019) | 10 lignes

Fixed: NotSerializableException after uploading images to an order
(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/branches/release17.12@1866261 13f79535-47bb-0310-9956-ffa450edef68
2019-09-02 07:34:03 +00:00
Jacques Le Roux 01125fef2b "Applied fix from trunk for revision: 1859972"
------------------------------------------------------------------------
r1859972 | jleroux | 2019-05-25 16:08:48 +0200 (sam. 25 mai 2019) | 12 lignes

Fixed: Duplicate entries in paramWithSuffix
(OFBIZ-11056)

when using string-list-suffix attribute for service definition, invoke method 
(from associated event handler) will try to parse parameters from both request 
variable and rawParameterMap which was also built from request. 
So we end up with duplicates in resulting list.

This behaviour seems to be introduced with OFBIZ-5048.


Thanks: Samuel Trégouët for report and fix 
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1859974 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 14:10:49 +00:00
Jacques Le Roux 6750a3de4a "Applied fix from trunk for revision: 1859800"
------------------------------------------------------------------------
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
2019-05-23 16:37:38 +00:00
Jacques Le Roux 69a46f08f4 "Applied fix from trunk for revision: 1857099"
------------------------------------------------------------------------
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
2019-04-13 17:50:42 +00:00
Jacques Le Roux b27ded6971 "Applied fix from trunk for revision: 1851998"
------------------------------------------------------------------------
r1851998 | jleroux | 2019-01-24 09:17:38 +0100 (jeu. 24 janv. 2019) | 11 lignes

Fixed: Impossible secure and autologin cookie names when mountpoint contains a 
slash inside its name
(OFBIZ-10766)

Deepak Nigam reported on dev ML:
When there is one web app with the empty mount point (i.e. deployed on root), 
the auto-login cookie will not work for that particular webapp due to the change 
in the path of the cookie from "/" to "/" + applicationName. Because the system 
will try to find the cookie at the "/" but it is actually at "/" + applicationName.

Thanks Deepak for report
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1852000 13f79535-47bb-0310-9956-ffa450edef68
2019-01-24 08:19:56 +00:00
Jacques Le Roux e9a3dd7ea2 "Applied fix from trunk for revision: 1851350"
------------------------------------------------------------------------
r1851350 | jleroux | 2019-01-15 14:48:33 +0100 (mar. 15 janv. 2019) | 7 lignes

Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)

As reported by Deepak Nigam on dev ML there was a risk of NPE with userLogin w/
my last commit at r1851074  

Thanks Deepak for the report and proposed fix
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1851352 13f79535-47bb-0310-9956-ffa450edef68
2019-01-15 13:48:58 +00:00
Jacques Le Roux 12292fb990 "Applied fix from trunk for revision: 1851247"
------------------------------------------------------------------------
r1851247 | jleroux | 2019-01-14 14:53:18 +0100 (lun. 14 janv. 2019) | 13 lignes

Fixed: User's name is displayed on ecommerce even after user logs out
(OFBIZ-10666)

On further investigation, I found that cookie path and domain are different 
in the methods of creating the auto-login cookie i.e. LoginWorker.autoLoginSet() 
and removing the auto-login cookie i.e. LoginWorker.autoLoginRemove().

After following changes the issue seems to be fixed:
1. Removed getMaxAge() check from the condition used in 
   LoginWorker.getAutoUserLoginId() method.
2. Corrected the path and domain in the method LoginWorker.autoLoginRemove().

Thanks: Deepak Nigam for discussion and fix
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1851249 13f79535-47bb-0310-9956-ffa450edef68
2019-01-14 13:54:42 +00:00
Jacques Le Roux cc97e3b633 "Applied fix from trunk for revision: 1851200"
------------------------------------------------------------------------
r1851200 | jleroux | 2019-01-13 14:31:13 +0100 (dim. 13 janv. 2019) | 11 lignes

Reverted: Impossible secure and autologin cookie names when mountpoint contains 
a slash inside its name
(OFBIZ-10766)

In my previous commit I reverted the initial change. As I said in the Jira
I had a second look and it's better to fix the problem at the root as I did 
initially. 

I wrote in my previous commit: "This method is used in other places where the 
name should not be changed." I checked there are no issues changing slashes to
underscores in the cookies names anywhere.
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1851203 13f79535-47bb-0310-9956-ffa450edef68
2019-01-13 13:43:44 +00:00
Jacques Le Roux 826977b857 "Applied fix from trunk for revision: 1851074 "
------------------------------------------------------------------------
r1851074 | jleroux | 2019-01-11 17:26:13 +0100 (ven. 11 janv. 2019) | 17 lignes

Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)

In the method to set the autoLogin cookie, LoginWorker::autoLoginSet,
system fetches the webAppInfo by using the
method ComponentConfig::getWebappInfo. In this method, serverId and
applicationName are passed as arguments.

*WebappInfo webappInfo = ComponentConfig.getWebappInfo((String)
context.getAttribute("_serverId"), UtilHttp.getApplicationName(request));*

If the mount-point of the web app is set as an empty string, then 'root'
will be used as the application name, due to which the object webAppInfo
will come null. If the webAppInfo is null then the autoLogin cookie will
not be created and added to the response object by the system.

Thanks: Aditya for report and Mathieu Lirzin for discussion
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1851076 13f79535-47bb-0310-9956-ffa450edef68
2019-01-11 16:27:11 +00:00
Jacques Le Roux c69fa05bd1 "Applied fix from trunk for revision: 1851068 "
------------------------------------------------------------------------
r1851068 | jleroux | 2019-01-11 17:12:01 +0100 (ven. 11 janv. 2019) | 12 lignes

Fixed: Add session tracking mode and make cookie secure
(OFBIZ-6655)

Following "Session timeout for webapps" discussion on dev ML 
https://markmail.org/message/p6fbiojjrwb2ybxd

We decided to put back the session-timeout value in web.xml files and to remove
the line
    session.setMaxInactiveInterval(60*60); //in seconds
from ControlEventListener.java

Thanks: Deepak Nigam for report and Girish Vasmatkar for discussion
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1851071 13f79535-47bb-0310-9956-ffa450edef68
2019-01-11 16:13:29 +00:00
Jacques Le Roux cce92d2a46 "Applied fix from trunk for revision: 1850694"
------------------------------------------------------------------------
r1850694 | jleroux | 2019-01-07 22:58:01 +0100 (lun. 07 janv. 2019) | 13 lignes

Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)

Michael spotted that I used "default-server" in r1845558:

Quoting him:

    It only works for webapps using "default-server". This name is configurable 
    in the ofbiz-component.xml and and should not be hard-coded in the code. 

This fixes it

Thanks: Michael Brohl
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1850696 13f79535-47bb-0310-9956-ffa450edef68
2019-01-07 21:59:34 +00:00
Jacques Le Roux 5298601fa9 "Applied fix from trunk for revision: 1850685"
------------------------------------------------------------------------
r1850685 | jleroux | 2019-01-07 21:37:10 +0100 (lun. 07 janv. 2019) | 8 lignes

Fixed: Impossible secure and autologin cookie names when mountpoint contains a 
slash inside its name
(OFBIZ-10766)

My previous commit was wrong this one fixes it.
I made a mistake trying to generalise changing UtilHttp::getApplicationName. 
This method is used in other places where the name should not be changed. 
Only cookies are concerned.
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1850687 13f79535-47bb-0310-9956-ffa450edef68
2019-01-07 20:41:58 +00:00
Aditya Sharma e5f863e422 Applied fix from trunk for revision: 1849275
===

Improved: Remove all the fk dependencies from stats entities to the business entities
(OFBIZ-10721)
stats related entities foreign key relation has been removed by Jacopo at r#1647271 and new group org.apache.ofbiz.stats introduced for stats related entity. Some remnants were still left in stats entities. 
Removed relations of Party, ContactMech and Content from ServerHit entity.
Removed relations of Content from ServerHitBin entity.
Removed relations of UserLogin from Visitor entity.
Thanks Jacques Le Roux and Deepak Dixit for the review.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1849288 13f79535-47bb-0310-9956-ffa450edef68
2018-12-19 10:33:30 +00:00
Michael Brohl 346f618c57 Applied fix from trunk for revision: 1848467
===

Improved: ControlEventListener - Change Log-Level
(OFBIZ-10330)

The Log-Level of the Message "Could not find visit value object in 
session..." is changed from "warning" to "info".

Thanks Benjamin Jugl for reporting and providing the patch.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1848468 13f79535-47bb-0310-9956-ffa450edef68
2018-12-08 12:53:09 +00:00
Jacques Le Roux 9e831df166 "Applied fix from trunk for revision: 1848398 "
------------------------------------------------------------------------
r1848398 | jleroux | 2018-12-07 14:14:48 +0100 (ven. 07 déc. 2018) | 17 lignes

Fixed: User's name is displayed on ecommerce even after user logs out
(OFBIZ-10666)

Steps to regenerate:
Open URL: https://demo-trunk.ofbiz.apache.org/ecommerce/control/main. 
  Welcome is displayed and user's name is not displayed when URL is opened.
Login at ecommerce, username will be displayed after user logs in.
Logout of ecommerce by clicking on logout. User will be logged out and login 
  link will be displayed in place of logout link, but the name of user is still 
  displayed.

Actual: Username is still displayed after user logs out
Expected: Username should not be displayed after the user logs out

Note: Similar issue also exists when the user clicks on (Not You?) link.

Thanks: Arpit Mor for detailled report, Deepak Dixit for discussion
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1848399 13f79535-47bb-0310-9956-ffa450edef68
2018-12-07 13:16:46 +00:00
Jacques Le Roux 512560e335 "Applied fix from trunk for revision: 1847478"
------------------------------------------------------------------------
r1847478 | jleroux | 2018-11-26 17:41:52 +0100 (lun. 26 nov. 2018) | 21 lignes

Improved: Multi Part Input Parameters not Available in Groovy Event
(OFBIZ-5048)

If a form is of type enctype="multipart/form-data" and we are handling its 
submission through Groovy Event then in the parameters Map Ofbiz does not set 
the multipart input parameters from request parameters.

The same are available when multipart form submission is handled through service.

The reason being the code that sets the multipart parameters in request 
attribute is only available in ServiceEventHandler.java and in 
GroovyEventHandler the multipart are never set.

So I have created a method getMultiPartParameterMap in the class UtilHttp.java 
and put the common logic in that method so that when getCombinedMap method is 
called from the GroovEventHandler the method also call getMultiPartParameterMap 
and in the ServiceEventHandler I have written a call for 
getMultiPartParameterMap method.

Thanks: Vikramjit Singh for report and initial patch, Rohit Koushal for updated
and revised patch with some minor changes.
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1847955 13f79535-47bb-0310-9956-ffa450edef68
2018-12-02 10:36:09 +00:00
Jacques Le Roux fad06400e2 Documented: Backport the Asciidoc documentation and means to generate it to
R17 branch
(OFBIZ-10657)

As discussed in https://markmail.org/message/x7sv2mpvtytr4vl4 we decided to 
backport the Asciidoc documentation, and means to generate it, to R17 branch

This is related with OFBIZ-10651 and OFBIZ-10652 tasks. 
So 2 parts are impacted: code in framework and plusing and Buildbot script. 
It's only a copy from the trunk to the R17 branch, including *.adoc files, 
related images and the build.gradle script.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1847248 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 12:00:10 +00:00
Jacques Le Roux 48db7b0306 "Applied fix from trunk for revision: 1845558 "
------------------------------------------------------------------------
r1845558 | jleroux | 2018-11-02 10:46:42 +0100 (ven. 02 nov. 2018) | 15 lignes

Fixed: Correct behaviour of Autologin cookies
(OFBIZ-10635)

Renames "keep-autologin-cookie" to "use-autologin-cookie", and only create 
Autologin cookies when needed. No need to create Autologin cookies in 
applications that don't need it.

Don't pass webAppName to LoginWorker::getSecuredUserLoginId, that can be handled
with improved LoginWorker::getSecuredLoginIdCookieName

Removes LoginWorker::autoLogoutCleanCookies, no longer needed since only those
needed are created and kept (1 year at least after creation).

For both autoLogin and securedLoginId cookies sets the path to the application.

------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1845568 13f79535-47bb-0310-9956-ffa450edef68
2018-11-02 10:38:33 +00:00
Jacques Le Roux 642d871210 "Applied fix from trunk for revision: 1845418"
------------------------------------------------------------------------
r1845418 | jleroux | 2018-11-01 10:36:35 +0100 (jeu. 01 nov. 2018) | 20 lignes

Fixed: Missing Security and Cache Headers in CMS Events
Fixed:
(OFBIZ-10597)

While rendering the view through the controller request we set the important 
security headers like x-frame-options, strict-transport-security, 
x-content-type-options, X-XSS-Protection and Referrer-Policy etc. in the 
response object. (Please see the 'rendervView' method of RequestHandler class.) 
 
In the similar line, we set the cache related headers like Expires, 
Last-Modified, Cache-Control, Pragma.
 
But these security headers are missing in the pages rendered through CMS. 
(Please visit the CmsEvents class).
 
These headers are very crucial for the security of the application as they help 
to prevent various security threats like cross-site scripting, 
cross-site request forgery, clickjacking etc. 

Thanks: Deepak Nigam for initial patch and review
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1845419 13f79535-47bb-0310-9956-ffa450edef68
2018-11-01 09:37:06 +00:00
Jacques Le Roux 758db9b5f5 "Applied fix from trunk for revision: 1843225 "
------------------------------------------------------------------------
r1843225 | jleroux | 2018-10-09 10:16:01 +0200 (mar. 09 oct. 2018) | 6 lignes

Documented: Wrong handling of response type "cross-redirect"
(OFBIZ-10569)

The documentation was wrong, this fixes it

Thanks: Dennis Balkir for the report and discussion
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1843226 13f79535-47bb-0310-9956-ffa450edef68
2018-10-09 08:17:12 +00:00
Aditya Sharma efb9ecbeaa Applied fix from trunk for revision: 1838256
===

Improved: Remove checks to store only 250 characters of URL in VisitHandler.getVisit() & ServerHitBin.saveHit()
(OFBIZ-10508)
When the code was committed the 'URL' field type had a size of 255 characters only which was later changed to 2000 characters. So, the above code logic to restrict no of characters can be removed now. 
Removed null pointer check for initialRequest and initialReferrer as it is already handled while setting the values in UtilHttp.setInitialRequestInfo() method.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1838257 13f79535-47bb-0310-9956-ffa450edef68
2018-08-17 12:53:32 +00:00
Taher A. Alkhateeb b82c52b234 Backported fix from trunk for revision: 1837697
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1837707 13f79535-47bb-0310-9956-ffa450edef68
2018-08-09 09:57:26 +00:00
Taher A. Alkhateeb e8e2791fd8 Backported fix from trunk for revision: 1836141
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1836142 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 06:32:46 +00:00
Deepak Dixit daae6ed07e Applied fix from trunk for revision: 1835235
===

Fixed: Framework webapp freemarkerTransform.properties has dependency on proudct component
(OFBIZ-10463)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1835238 13f79535-47bb-0310-9956-ffa450edef68
2018-07-06 11:51:24 +00:00
Jacques Le Roux a03229ea99 "Applied fix from trunk for revision: 1832944 "
------------------------------------------------------------------------
r1832944 | jleroux | 2018-06-05 15:56:29 +0200 (mar. 05 juin 2018) | 17 lignes

Fixed: The first visit event are not executed in case of CMS
(OFBIZ-10389)

Execution of the first visit events depends on the trackVisit function

In RequestHandler.java file

if (this.trackVisit(request) && session.getAttribute("_FIRST_VISIT_EVENTS_") == null) {
    // execute first visit event
}

trackVisit function does not honor the default controller request 
(in this case, cms) So, we should improve the code of trackVisit to honor 
default controller request.


Thanks: Swapnil M Mane
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1832945 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 13:57:18 +00:00
Jacques Le Roux bac7aeb9ef "Applied fix from trunk for revision: 1832756"
------------------------------------------------------------------------
r1832756 | jleroux | 2018-06-03 10:33:09 +0200 (dim. 03 juin 2018) | 21 lignes

Fixed: Session fixation issue
(OFBIZ-10420)

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). Only do when really signing in to avoid unnecessary 
calls

This improves the way it's done by using request.changeSessionId() instead of 
creating a brand new session. So there is no possible side effects on client and
no need to set initial request info (using setInitialRequestInfo)

Thanks: Taher for asking about it









------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1832757 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 08:34:32 +00:00
Jacques Le Roux c9c60234ad "Applied fix from trunk for revision: 1832662 "
------------------------------------------------------------------------
r1832662 | jleroux | 2018-06-01 09:37:27 +0200 (ven. 01 juin 2018) | 12 lignes

Fixed: Session fixation issue
(OFBIZ-10420)

Fixes a session fixation security issue discovered by a client with the security
 audit tool "IBM Security AppScan Enterprise , Version : 9.0.3.7"

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). 

Only do when really signing in to avoid unnecessary calls
Though if the client has disabled the use of cookies, then a session will be 
new on each request, not a good choice on client side!

------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1832663 13f79535-47bb-0310-9956-ffa450edef68
2018-06-01 07:38:09 +00:00
Jacques Le Roux 8a40cc383f "Applied fix from trunk for revision: 1832577"
------------------------------------------------------------------------
r1832577 | zhangwei | 2018-05-31 03:20:54 +0200 (jeu. 31 mai 2018) | 1 ligne

Fixed: Incorrect data type conversion of variable serviceEndTime in CoreEvents.java
(OFBIZ-10419)

A minor fix for serviceEndTime conversion
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1832659 13f79535-47bb-0310-9956-ffa450edef68
2018-06-01 06:27:03 +00:00
Nicolas Malin 5b347ad958 Fixed: Backport from trunk, ConfigXMLReader - Events are not executed in the order defined
(OFBIZ-10369)
The events contained in the controller configuration for first-visit, pre-post processor and before-after login are executed in arbitrary order rather than the defined order.
If we define an event configuration as follow:

    <after-login>
        <event name=keepCartUpdated type=java path=org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents invoke=keepCartUpdated/>
        <event name=restoreAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=restoreAutoSaveList/>
        <event name=saveCartToAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=saveCartToAutoSaveList/>
    </after-login>

We wait that OFBIz run keepCartUpdated, restoreAutoSaveList and after saveCartToAutoSaveList event but the HashMap who organise them return arbitrary order and can return saveCartToAutoSaveList, keepCartUpdated and restoreAutoSaveList. Convert the HashMap to LinkedHashMap help to keep the loaded order.

Thanks to Vikas Mayur for solve this issue

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1830305 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 07:40:28 +00:00
Jacques Le Roux 61f2257f69 Improved: Logout do not remove autoLogin
(OFBIZ-4959)

No functional change: formatting

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1827533 13f79535-47bb-0310-9956-ffa450edef68
2018-03-22 21:39:58 +00:00
Jacques Le Roux 9d42de74dd Reverted: Token Based Authentication
(OFBIZ-9833)

This was a new feature committed the 2017-10-29 and has completely changed since.
It should not stay as is in R17.12



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1827528 13f79535-47bb-0310-9956-ffa450edef68
2018-03-22 20:57:26 +00:00
Jacques Le Roux cf996f24a3 "Applied fix from trunk for revision: 1827441 "
------------------------------------------------------------------------
r1827441 | jleroux | 2018-03-21 21:59:49 +0100 (mer., 21 mars 2018) | 4 lines

Fixed: Token Based Authentication
(OFBIZ-9833)

Reverts change in ContextFilter.java committed with 1813679, was wrong
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1827442 13f79535-47bb-0310-9956-ffa450edef68
2018-03-21 21:00:50 +00:00