Commit Graph
26794 Commits
Author SHA1 Message Date
Jacques Le Roux e0f0d5271a Fixed: Prevent Host Header Injection (CVE-2019-12425)
(OFBIZ-11583)
2020-04-04 19:32:02 +02:00
Jacques Le Roux ba548f626e 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
2020-04-04 17:58:07 +02:00
Jacques Le Roux 645d419574 Merge branch 'trunk' into POC-for-CSRF-Token-OFBIZ-11306 2020-04-04 17:52:06 +02:00
Jacques Le Roux 768353a093 Improved:
Implemented:
Documented:
Completed:
Reverted:
Fixed:

(OFBIZ-)
Explanation
Thanks:
2020-04-04 15:49:49 +02:00
Jacques Le Roux 5bc579ab4a Merges OFBiz trunk 2020-04-04 15:49:49 +02:00
Nicolas Malin 37f33f48ff Fixed: correct path to ftpAddress services
(OFBIZ-11359)

After the minilang ContactMarchServices.xml to groovy, I forgot to change
the path of existant ftpAddress services already present before.

Thanks to Olivier Heintz for this alert
2020-04-04 15:49:44 +02:00
Nicolas Malin 8fc5028be9 Fixed: correct path to ftpAddress services
(OFBIZ-11359)

After the minilang ContactMarchServices.xml to groovy, I forgot to change
the path of existant ftpAddress services already present before.

Thanks to Olivier Heintz for this alert
2020-04-04 15:49:43 +02:00
Harutyun Farajyan 4594fc4964 Improved: Convert PartyPermissionServices.xml from mini lang to groovy
(OFBIZ-11433)

Thanks to Harutyun Farajyan for providing the patch
2020-04-04 15:49:43 +02:00
Jacques Le Roux c9d516d367 Fixed: The createTaskContent request does not work
(OFBIZ-11246)

It seems that same request can not be parsed multiple times if it has multi part
object in it as the parse method remove it after that.

Found one stackoverflow link around the same:

https://stackoverflow.com/questions/13881272/
servletfileuploadparserequestrequest-returns-an-empty-list

I believe that all places/uploads using this workflow should resulting the same
issue.

One possible solution I could think of without going with new approach is to set
list of file Items into the request attribute and use it if parse method remove
it and unable to retrieve on 2nd call.

Thanks: Ankush Upadhyay for the analysis and initial patch. I only slightly
modified it.
2020-04-04 15:49:43 +02:00
Jacques Le Roux e666c65b7c 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-04-04 15:49:43 +02:00
Jacques Le Roux ae3ae26698 Improved: type="text/css" was missing on a call to <<link rel="stylesheet/less>>
This was reported by OWASP ZAP: "The Content-Type header is missing or empty."
Considered a low vulnerability
2020-04-04 15:49:43 +02:00
Jacques Le Roux f2e69894fb Improved: Implement the pretty print for keyword search
(OFBIZ-11476)

With OFBIZ-9164 and r1835891 I introduced
keywordConstraint::prettyPrintConstraint without implementation.
So the information is missing at top of page.

This implements it. It also amends 2 French labels
2020-04-04 15:49:42 +02:00
Jacques Le Roux 060e9ab950 Improved: no functional change
Adds /uploads/ in .runtime/.gitignore
2020-04-04 15:49:42 +02:00
Pierre Smits 6c66ce0dc2 Fixed: DataModel - correct foreign key (#51)
(OFBIZ-11474)

Renaming foreign key to PROD_PRCDE_OPCD
2020-04-04 15:49:42 +02:00
Pierre Smits c89e9346ba Improved: unify style application
(OFBIZ-11458)

remove unused property 'align-float'
2020-04-04 15:49:42 +02:00
Pierre Smits 321e51602a Improved: unify style application
(OFBIZ-11458)

replace 'align-float' with 'align-text'
2020-04-04 15:49:42 +02:00
Pierre Smits 20cf076c44 Improved: unify style application
(OFBIZ-11458)

replace 'align-float' with 'align-text'
2020-04-04 15:49:42 +02:00
Pierre Smits 48e81c48db Improved: style alignment properties
(OFBIZ-11458)

Adding alignment properties (creating consistency across themes.
2020-04-04 15:49:41 +02:00
Pawan Verma 4d2e5d3e26 Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.(OFBIZ-5426) (#44)
* Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.
(OFBIZ-5426)

The problem is in the entity model. An email address should not be used in the primary key - mainly because an email address is case-insensitive. A better design would be to use the email address contact mechanism ID in the primary key.

Done Following:
1. Changed Entity Name from ProductPromoCodeEmail to ProductPromoCodeContMech
2. Related Changes for the entity name change
3. Migration service to migrate old data

Thanks, Leon for the report and Adrian Crum, Jacques Le Roux, Ingo Wolfmayr, Deepak Dixit, Pierre Smits and Gil Portenseigne for the discussion and review.

* Improved: Added new line in service definition file and lincence in MigrationServices file.
(OFBIZ-5426)

Thanks, Jacopo for the review.
2020-04-04 15:49:41 +02:00
Jacques Le Roux 43f46399ff Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes check style errors
2020-04-04 15:49:41 +02:00
Jacques Le Roux c68d43efa2 Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes an issue due to Eclipse automated import organisation.

There are still check style errors
2020-04-04 15:49:41 +02:00
Jacques Le Roux d1ca68c166 Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes a check issue (line too long)

Notice: on Windows I get 20 errors when compiling:
> Task :compileTestJava FAILED
C:\projectsASF\Git\ofbiz-framework\framework\widget\src\test\java\org\apache\
ofbiz\widget\renderer\macro\MacroFormRendererTest.java:134:
error: annotation type not applicable to this kind of declaration
        @Mock
        ^
I guess the change in build.gradle are not enough for Windows, to be seen later...
2020-04-04 15:49:41 +02:00
Daniel Watford 1fbf6c3d6b Improved: Added license header to MacroFormRendererTest
(OFBIZ-4035)
2020-04-04 15:49:41 +02:00
Daniel Watford 87277ab992 Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)
2020-04-04 15:49:40 +02:00
Jacques Le Roux 11c75b6661 Fixed: Ensure that the SameSite attribute is set to 'strict' for all cookies.
(OFBIZ-11470)

Fixes a typo
2020-04-04 15:49:40 +02:00
Jacques Le Roux 866c742e8f 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
2020-04-04 15:49:40 +02:00
Jacques Le Roux 6c49411ee7 Improved: "auth" should be true for all the request url used for Application
components

(OFBIZ-4956)

Currently there are some URLs present in application components with
auth="false". So anyone can hit these URLs and access these resources without
authorization.
I think all the URLs should be secure with auth="true"

jleroux: I have also fixed the dataResourceId="GZ-DIG"

Thanks: Amardeep Singh Jhajj for report and initial fix
2020-04-04 15:25:51 +02:00
Ulrich Heidfeld 8ee522e42e Improved: Decodes AjaxAutocompleteOptions return value
(OFBIZ-11475)
2020-04-02 09:15:45 +02:00
Pawan Verma 3b86754e14 Improved: Added new data model changes done under OFBIZ-5426 in DataModel changes file. (#55)
(OFBIZ-5426)

Thanks, Deepak Dixit for the report.
2020-03-30 23:21:43 +05:30
Jacques Le Roux 019b58859e Improved: POC for CSRF Token
(OFBIZ-11306)

There is no need to change it there because, apart the ecommerce application,
there are no applications that requires an anonymous flow.
It should be only changed in ecommerce controller.
2020-03-27 14:42:40 +01:00
Nicolas Malin e922d34e59 Fixed: correct path to ftpAddress services
(OFBIZ-11359)

After the minilang ContactMarchServices.xml to groovy, I forgot to change
the path of existant ftpAddress services already present before.

Thanks to Olivier Heintz for this alert
2020-03-27 11:46:11 +01:00
Nicolas Malin b6944ded4c Fixed: correct path to ftpAddress services
(OFBIZ-11359)

After the minilang ContactMarchServices.xml to groovy, I forgot to change
the path of existant ftpAddress services already present before.

Thanks to Olivier Heintz for this alert
2020-03-27 11:41:03 +01:00
Harutyun Farajyan ae686c3ff6 Improved: Convert PartyPermissionServices.xml from mini lang to groovy
(OFBIZ-11433)

Thanks to Harutyun Farajyan for providing the patch
2020-03-27 11:11:32 +01:00
Jacques Le Roux f4acda5ade Fixed: The createTaskContent request does not work
(OFBIZ-11246)

It seems that same request can not be parsed multiple times if it has multi part
object in it as the parse method remove it after that.

Found one stackoverflow link around the same:

https://stackoverflow.com/questions/13881272/
servletfileuploadparserequestrequest-returns-an-empty-list

I believe that all places/uploads using this workflow should resulting the same
issue.

One possible solution I could think of without going with new approach is to set
list of file Items into the request attribute and use it if parse method remove
it and unable to retrieve on 2nd call.

Thanks: Ankush Upadhyay for the analysis and initial patch. I only slightly
modified it.
2020-03-27 10:55:59 +01:00
Jacques Le Roux 2bb1de22cc 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:05:37 +01:00
Jacques Le Roux bd1b8a882d Improved: type="text/css" was missing on a call to <<link rel="stylesheet/less>>
This was reported by OWASP ZAP: "The Content-Type header is missing or empty."
Considered a low vulnerability
2020-03-26 12:12:37 +01:00
Jacques Le Roux 5988e27a0d Improved: Implement the pretty print for keyword search
(OFBIZ-11476)

With OFBIZ-9164 and r1835891 I introduced
keywordConstraint::prettyPrintConstraint without implementation.
So the information is missing at top of page.

This implements it. It also amends 2 French labels
2020-03-26 11:07:29 +01:00
Jacques Le Roux 11c0ce6d55 Improved: no functional change
Adds /uploads/ in .runtime/.gitignore
2020-03-24 18:31:54 +01:00
Pierre Smits dc68ac089f Fixed: DataModel - correct foreign key (#51)
(OFBIZ-11474)

Renaming foreign key to PROD_PRCDE_OPCD
2020-03-24 14:45:58 +05:30
Pierre Smits 3f01b0d422 Improved: unify style application
(OFBIZ-11458)

remove unused property 'align-float'
2020-03-24 09:01:40 +01:00
Pierre Smits 1f1d25b39f Improved: unify style application
(OFBIZ-11458)

replace 'align-float' with 'align-text'
2020-03-24 09:01:40 +01:00
Pierre Smits 3c5224c351 Improved: unify style application
(OFBIZ-11458)

replace 'align-float' with 'align-text'
2020-03-24 09:01:40 +01:00
Pierre Smits 5767da5e15 Improved: style alignment properties
(OFBIZ-11458)

Adding alignment properties (creating consistency across themes.
2020-03-24 09:01:40 +01:00
Jacques Le Roux ef8546bf19 Improved: POC for CSRF Token
(OFBIZ-11306)

There is no need to change it there because, apart the ecommerce application,
there are no applications that requires an anonymous flow.
It should be only changed in ecommerce controller.
2020-03-23 15:30:40 +01:00
Pawan Verma 91673f1b41 Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.(OFBIZ-5426) (#44)
* Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.
(OFBIZ-5426)

The problem is in the entity model. An email address should not be used in the primary key - mainly because an email address is case-insensitive. A better design would be to use the email address contact mechanism ID in the primary key.

Done Following:
1. Changed Entity Name from ProductPromoCodeEmail to ProductPromoCodeContMech
2. Related Changes for the entity name change
3. Migration service to migrate old data

Thanks, Leon for the report and Adrian Crum, Jacques Le Roux, Ingo Wolfmayr, Deepak Dixit, Pierre Smits and Gil Portenseigne for the discussion and review.

* Improved: Added new line in service definition file and lincence in MigrationServices file.
(OFBIZ-5426)

Thanks, Jacopo for the review.
2020-03-23 17:08:58 +05:30
Jacques Le Roux 1348f9d3be Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes check style errors
2020-03-21 23:09:05 +01:00
Jacques Le Roux 28e961c062 Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes an issue due to Eclipse automated import organisation.

There are still check style errors
2020-03-21 23:01:36 +01:00
Jacques Le Roux 322df2750c Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)

Fixes a check issue (line too long)

Notice: on Windows I get 20 errors when compiling:
> Task :compileTestJava FAILED
C:\projectsASF\Git\ofbiz-framework\framework\widget\src\test\java\org\apache\
ofbiz\widget\renderer\macro\MacroFormRendererTest.java:134:
error: annotation type not applicable to this kind of declaration
        @Mock
        ^
I guess the change in build.gradle are not enough for Windows, to be seen later...
2020-03-21 22:08:00 +01:00
Daniel Watford e2142dd00e Improved: Added license header to MacroFormRendererTest
(OFBIZ-4035)
2020-03-21 20:02:59 +01:00
Daniel Watford 05d734206a Improved: Added unit testing, using JMockit, to ensure that form macros are
rendered using ids from ModelFormField#getCurrentContainerId.

(OFBIZ-4035)
2020-03-21 20:02:59 +01:00