Currently, session timeout is configured in apps separately, but session is
shared globally, so the smallest one take effects, and it will not take effect
separately for different apps.
Then it is both inconvenient and confusing to increase session timeout value,
as all values in those files need to be updated.
A global web.xml is needed, to simplify session timeout configuration.
Thanks: Xin Wang
(OFBIZ-11470)
As reported by OWASP ZAP:
A cookie has been set without the SameSite attribute, which means that the
cookie can be sent as a result of a 'cross-site' request. The SameSite attribute
is an effective counter measure to cross-site request forgery, cross-site script
inclusion, and timing attacks.
The solution was not obvious in OFBiz for 2 reasons:
1. There is no HttpServletResponse::setHeader. So we need to use a filter
(SameSiteFilter) and even that is not enough because of 2:
2. To prevent session fixation we force Tomcat to generates a new jsessionId,
ultimately put in cookie, in LoginWorker::login. So we need to add a call to
SameSiteFilter::addSameSiteCookieAttribute in
UtilHttp::setResponseBrowserDefaultSecurityHeaders.
These declarations avoid SAXParseException traceback when parsing web.xml
the first time in WebappUtil.parseWebXmlFile
A schema conformance issue has been fixed in ecommerce “web.xml”.
(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-plugins/trunk@1851068 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-6655)
Programmatically replaces the web.xml <session-config> declarations and uses
the @WebListener annotation to start the process. This avoid to duplicates
things everywhere in web.xml files. Since the web.xml files have precedence
on annotations, the setting can be easily overridden when necessary.
Now that we also use HTTPS in ecommerce the ecommerce session cookie is
also secured.
I also noted that we had 8 weird <session-timeout> declarations:
in solr component: <session-timeout>2</session-timeout>
in themes: <session-timeout>1</session-timeout>
Also in Rainbowstone we lacked the <cookie-config> and <tracking-mode>
declarations. I think it's not good.
I resolve these points by simply removing the <session-config> in web.xml files
of themes and Solr.
Thanks: Pradhan Yash Sharma for review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1811041 13f79535-47bb-0310-9956-ffa450edef68
Consistency on the attribute order for view-map element as : name, type, page
Thanks to Ankush Upadhyay and Devanshu Vyas for the issue and the corrective patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1805891 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9123)
Moved pricat/webapp/pricat/ftl to pricat/template/pricat, pricat/webapp/pricatdemo/ftl to pricat/template/pricatdemo, and changed paths in files accordingly.
Thanks Jacques, Pierre and Michael for the code review and suggestion on this improvement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1788744 13f79535-47bb-0310-9956-ffa450edef68
completes r1781219 by putting svn:eol-style=native to all file types declared
in [auto-props] section of the svn config files.css
Actually this is only a 1st pass, it was too complicated to do it for
all file types at once only concerned here
*.java;*.bsh;*.groovy;*.jsp;*.tld;*.ftl;*.js;*.sql;*.c;*.cpp;*.h;*.txt;*.sgml;
*.properties;*.xml;.classpath;.project;*.sld;*.gml;*.xsl;*.xsd
*.html;*.htm;*.css;*.md;README;NOTICE;LICENSE;rc.ofbiz.*;*.less;*.dsp;*.dsw
Most files should not be concerned by this change, but it's impossible to do
it one by one.
There are also changes in files with have mixed EOLs; because this has no sense
when using native which automatically resolves this issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/plugins@1781731 13f79535-47bb-0310-9956-ffa450edef68