(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.
(OFBIZ-10322)
Create a README.adoc stub and help file stub in the new format under
framework/resources/templates and use in the plugin creation task.
Thanks Ulrich Heidfeld for providing the patch.
(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-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
(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/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-framework/trunk@1811041 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9273)
Problem:
When you enter
bq. gradlew createTenant -PtenantId=test
you get
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\projectsASF\ofbiz-framework\build.gradle' line: 764
* What went wrong:
A problem occurred evaluating root project 'ofbiz'.
> Could not get unknown property 'pluginId' for task ':installAllPlugins' of
type org.gradle.api.DefaultTask.
Investigation:
This issue is due creation of build.gradle file in plugin (with empty gradle
task defined in it)
Solution:
Comment out build.gradle template content
Thanks: Deepak for confirmation, Swapnil M Mane for the investigation and patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1791143 13f79535-47bb-0310-9956-ffa450edef68
new ControlFilter, from the ContextFilter; modified existing applications to use
the two filters in a chain; removed from the other specialized filters all the
logic that was duplicated or extended from ContextFilter.
A web application, in order to leverage the OFBiz framework, requires that a
series of objects are in its contexts (servlet context, session and request)
such as "delegator", "delegatorName", "dispatcher", "security" etc. etc...
This setup is performed by the logic contained in the servlet filter implemented
by the ContextFilter class.
The execution of this logic is required for the application to run properly.
However, before this commit, in the ContextFilter there was other logic, related
to access control and redirection rules (some of them performed in coordination
with the ControlServlet), making it difficult to deploy this filter in all the
web applications, especially the ones that implement special handling of paths.
In fact, this filter was deployed in most but not all the web application in the
OFBiz codebase: specifically it was not deployed in web applications that
require the execution of other filters (e.g. CatalogUrlFilter, etc...) like the
ones in the "ecommerce" and "solr" components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761304 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7972)
This commit creates a basic plugin API for OFBiz that interoperates
with maven repositories. We are committing this code as "experimental"
to allow contributors to start experimenting with this system easily
as per the discussion on the above JIRA and in ML in the below thread.
This new plugin API is documented in README.md and provides the following
new gradle tasks for managing plugins:
- createPlugin: creates a new plugin based on templates, place it in
the plugins directory and activate it (add to component-load.xml)
- installPlugin: Activate a plugin and run its Install task. Plugin
must exist already in /specialpurpose
- uninstallPlugin: Deactivate a plugin and run its uninstall task
- removePlugin: Uninstall a plugin and then delete it from the filesystem
- pushPlugin: publish a plugin to local maven repository
- pullPlugin: download a plugin with its dependencies (plugins) from
a repository and install them
Discussion: http://markmail.org/message/h7fiicba2rtyl6cb
Thanks: Jacopo Capellato, Michael Brohl, Gil Portenseigne for feedback
and testing
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760917 13f79535-47bb-0310-9956-ffa450edef68
1) Removed 'maincss.css' entry from 'allowedPaths' param of from web.xml
Reason: Since, there is no file like 'maincss.css' exist under any includes directory.
2) Removed the unused references of maincss.css from FTLs, code
<link rel="stylesheet" href="${StringUtil.wrapString(baseUrl!)}/images/maincss.css" type="text/css"/>
has been removed.
Reason: This is an interesting thing, these FTLs were using the maincss.css located under the images directory.
When I look the history of these files, following were my findings,
The 'maincss.css' file under the 'images' directory exist in release4.0
http://svn.apache.org/repos/asf/ofbiz/branches/release4.0/framework/images/webapp/images/
after this release, this files no longer exist there.
3) Also, I have updated one file 'InventoryNoticeEmail.ftl' and used the basic HTML code to style, instead of using style defined in 'maincss.css' which were exist in release-4.0
4) Updated some references from 'maincss.css' to style.css in comments.
5) Also removed the entry of including '/images/maincss.css' and '/images/mainrtl.css' in SimpleDecorator
Since, these files no longer exist after release-4.0.
Thanks Wai for reviewing the work and thanks Swapnil M Mane for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758389 13f79535-47bb-0310-9956-ffa450edef68
Notes:
* Also removes empty framework/base/lib/scripting and useless applications\content\lib\uno\README (miss doc in wiki)
* When jpim-0.1.jar will be (hopefully) replaced we can drop lib ref in framework/base/ofbiz-component.xml
* I wonder if we should let the geronimo component alone with only 2 classes, could we not put that in entity or entityext?
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755306 13f79535-47bb-0310-9956-ffa450edef68
This is the first patch that takes OFBiz to the point of no return
in terms of switching from Ant to Gradle build system. Specifically
this patch applies the following items:
- Delete all old Ant and Maven build scripts
- Delete 169 Jar libraries and replace them with remote ones in the
gradle build script
- update the gradle build scripts for the dependencies and other minor
changes needed for the script work correctly
All tests pass with the command ./gradlew cleanAll loadDefault testIntegration
Again, thank you for everyone who contributed valueble time and effort in this
process.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752033 13f79535-47bb-0310-9956-ffa450edef68
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
As suggested by Deepak keeps only <<web-app version="3.0">> in web.xml files instead of whole xmlns and schemaLocation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1726388 13f79535-47bb-0310-9956-ffa450edef68
Need to enhance security at web-app level.
As per current implementation:
- The cookie containing the session identifier is not secure
- The session identifier is transmitted in the query string of the URL
To fix these issue we have to add following session config otpions in web.xml
{code}
<session-config>
<cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
{code}
Also we need to update the web-app servlet specification from 2.3 to 3.0
{code}
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
{code}
https://tomcat.apache.org/whichversion.html
jleroux: these are only the framework+themes+applications patches, with 3 entries not applied
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1719872 13f79535-47bb-0310-9956-ffa450edef68
This commit might break some Groovy scripts. There seemed to be a lot of C&P widget import statements, but there were no widget classes being used in the script, so I removed them. I might have overlooked something though.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1652852 13f79535-47bb-0310-9956-ffa450edef68
Adds
<auto-detect/>
in the fonts section of our fop.xconf
Adds the Google NotoSans font which is Apache licensed
* http://www.google.com/fonts/specimen/Noto+Sans
* https://www.google.com/get/noto/#/
Uses NotoSans as the default FOP font. For that puts the NotoSans font 4 files in framework/resources/fonts and add <directory>framework/resources/fonts/NotoSansFonts</directory> in fop.xconf
Renders ₹ in content/control/fonts.pdf as we do for €. Other symbols could be added later when needed, backed by Google NotoSans font...
Renders the NotoSans content/control/fonts.pdf as we do for other main fonts
Adds the rupee symbol (₹) to antisamy-esapi.xml file like we have the euro symbol (€)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647782 13f79535-47bb-0310-9956-ffa450edef68
Thanks Divesh and Mridul for helping with resuluation.
Thanks Adrian for reporting it.
Thanks Chris Snow for reporting the issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1632793 13f79535-47bb-0310-9956-ffa450edef68
added/revised zh-TW translations in the framework, applications and specialpurpose folders to have consistent, commonly-used meaningful terms in Traditional Chinese.
jleroux: from Nick Ho's patch I have extracted only the Chinese changes, w/o the proposed dash to underscore changes
This contains notably this 14 "zh" (not "sh-TW") changes:
<value xml:lang="zh">人将由电子邮件接受一个临时密码。</value><!-- was 客户将通过电子邮件收到一个临时密码。 -->
<value xml:lang="zh">合计属于公司: </value>
<value xml:lang="zh"> 完整文本:${fullText}</value>
<value xml:lang="zh">供货商佣金百分比</value>
<value xml:lang="zh">文本大小</value>
<value xml:lang="zh">值</value>
<value xml:lang="zh">算子</value>
<value xml:lang="zh">不能转移已序列化的库存。</value>
<value xml:lang="zh">货运收据</value>
<value xml:lang="zh">获取标识为 ${productStoreShipMethId} 的产品店铺送货方法(ProductStoreShipmentMeth)时出错:${errorString}</value>
<value xml:lang="zh">中国人民币元</value>
<value xml:lang="zh">如果选择"specify other",下拉框旁边会出现文本框。参考form的drop-down元素的other-field-size属性说明</value>
<value xml:lang="zh">文本消息</value>
<value xml:lang="zh">能够收到和解析XML消息,但是BSR->NOUN(买卖关系->名词) ${bsrNoun} 和/或 BSR->VERB(买卖关系->动词) ${bsrVerb} 是空的</value>
I have no competency to judge these changes, but from previous Shi Jinghai's feedback I believe there are OK
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1625816 13f79535-47bb-0310-9956-ffa450edef68
more added/updated translations patch files for zh-TW locale
jleroux:
I added the label
<value xml:lang="zh_TW">服務執行程式拋出一個異常</value>
by hand
Only 1 label was not added:
<value xml:lang="zh_TW">代號</value>
Because of the fuzziness and presence of several possibilities
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621688 13f79535-47bb-0310-9956-ffa450edef68
Remove useless and confusing websiteId in web.xml files
I did not remove some others, but I believe they don't make sense as they are.
Take for instance those data
<WebSite webSiteId="EBAY_STORE1" siteName="eBay Store1" standardContentPrefix="http://demo.ofbiz.org" productStoreId="90101"/>
<WebSite webSiteId="EBAY_STORE2" siteName="eBay Store2" standardContentPrefix="http://demo.ofbiz.org" productStoreId="90102"/>
<WebSite webSiteId="GOOGLEBASE" standardContentPrefix="http://demo.ofbiz.org" productStoreId="9000" />
Sorry but http://demo.ofbiz.org/ leads nowhere!
And do we need to keep those referring to productStoreId="9000" in web.xml files? They have not their own webapps
<WebSite webSiteId="CmsSite" siteName="CMS Web Site"/>
<WebSite webSiteId="OfbizSite" siteName="OFBiz Web Site"/>
<WebSite webSiteId="GOOGLECHECKOUT" productStoreId="9000" />
<WebSite webSiteId="GOOGLECHECKOUT" productStoreId="9000" />
I think we should keep in web.xml files, only ecommerce/clone and webPos (uses POS store)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1526686 13f79535-47bb-0310-9956-ffa450edef68
Security is now by default not loaded because not part of seed anymore this will make all component hidden and not accessible .
It is still loaded as part of the reader 'demo'
to load the security files:
./ant load-readers -Ddata-readers=security
Now it is possible to load only a selection of the security files in your hot-deploy component as follows:
<entity-resource type=data reader-name=seed loader=main location=../../framework/security/data/SecurityData.xml/>
<entity-resource type=data reader-name=seed loader=main location=../../framework/webtools/data/WebtoolsSecurityData.xml/>
<entity-resource type=data reader-name=seed loader=main location=../../applications/party/data/PartySecurityData.xml/>
This will enable only standard groups, the party and the webtools application.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1346255 13f79535-47bb-0310-9956-ffa450edef68
This commit also removes the demonstration widgetVerbose setting in the Example component's web.xml file - which caused some confusion, and it comments out the setting in the web.xml file that is used for creating new components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1172954 13f79535-47bb-0310-9956-ffa450edef68