Commit Graph
25719 Commits
Author SHA1 Message Date
Jacques Le Roux c32abb81d2 Fixed: Use Labels in themes names (OFBIZ-9863)
Fixes wrong C/P done with r1865370
2021-03-12 11:20:40 +01:00
Jacques Le Roux 9dd2a255e9 Fixed: webtools/control/threadList no longer works on trunk (only) (OFBIZ-12195)
It works if we downgrade Freemarker to 2.3.28 as in R18 and even using 2.3.29,
not 2.3.30.

Handles things at the Groovy level, ie put in context, rather than creating
in Freemarker template.

It's backported, even if it's not a pb but in trunk, because it's a (low)
security issue.
2021-03-12 08:59:32 +01:00
Jacques Le Roux 69f00cff78 Revert "Fixed: Error in deleting Financial Account (OFBIZ-12153)"
This reverts commit 2876adf26c.
2021-03-05 06:20:03 +01:00
Jacques Le Roux d93f7ce590 Fixed: When creating blog or forums, it failed to save (OFBIZ-10426)
Create a blog or forum and click save button, it will popup with error message.
The reason is because the mapKey passed from front end cannot be handled by the
service. The solution is not to pass the mapKey to the service.

Steps:

1) navigate to content/control/blogContent?blogContentId=BLOGROOTBIGAL

2) create a new article  content/control/EditBlogArticle?blogContentId=BLOGROOTBIGAL

Thanks: Jason Hao for report and Aman Mishra for the fix
2021-03-02 19:50:09 +01:00
Jacques Le Roux 7756b11421 Fixed: Upgrade Tomcat from 9.0.41 to 9.0.43 (OFBIZ-12165)
Fixes 2 security issues:

CVE-2021-25122 h2c request mix-up
Severity: Important

CVE-2021-25329 Incomplete fix for CVE-2020-9484 (RCE via session persistence)
Severity: Low
2021-03-01 23:21:36 +01:00
Jacques Le Roux 2876adf26c Fixed: Error in deleting Financial Account (OFBIZ-12153)
1. Navigate to URL: accounting/control/FindFinAccount
2. Click on Find button. List of fin account will be displayed.
3. Click on delete button near available balance column.

Thanks: Lalit Dashora for report, Sourabh Jain for the fix
2021-03-01 14:33:27 +01:00
Jacques Le Roux b5cdcd9efc Fixed: fixes testUpdatePartyCreditCard found by Buildbot
Changes all expireDate to 02/2100.
I'll not know if OFBiz will still be alive then, hope you will

All done by hand
2021-02-28 20:17:42 +01:00
Jacques Le Roux 78f09e61ad Fixed: Overlapped labels in Accounting transaction pdf export (OFBIZ-12110)
1. Navigate to URL: accounting/control/FindAcctgTrans
2. Click on search button and then click on export as pdf button
3. Validate the export pdf file, here labels are overlapped in pdf header.

Thanks: Lalit Dashora for report and enehlauri on GH with PR-281 for the fix
2021-02-28 11:34:27 +01:00
Michael Brohl ec4bff76a0 Improved: Switch from jCenter to mavenCentral to handle the jCenter
shutdown (OFBIZ-12171)
2021-02-27 14:43:54 +01:00
Michael Brohl d6c6330b39 Improved: Upgrades Gradle due to the jCenter to mavenCentral migration
(OFBIZ-12171)
2021-02-27 14:43:54 +01:00
Michael Brohl 2b8f4f8b64 Fixed: Corrects wrong API use for Collections and Arrays
edu.emory.mathcs.backport.java.util.* instead of java.util.*
which was spotted during the jCenter to mavenCentral migration.
2021-02-27 14:43:54 +01:00
Jacques Le Roux 392f18f913 Improved: Enlarge the "more-app" menu in Rainbow Stome theme (OFBIZ-12181)
Enlarges #more-app in rainbowstone-main-theme.less from 40 to 200px
2021-02-26 10:31:22 +01:00
Jacques Le Roux 1cf9d9110b Fixed: Error while running MRP (OFBIZ-12187)
I tried running MRP for Sales Forecast option and it returned the following error.

Error running the initMrpEvents service: Service [initMrpEvents] target threw
an unexpected exception (java.sql.Timestamp cannot be cast to java.sql.Date)

Thanks: Nameet Jain

Conflict handled by hand
2021-02-23 13:02:11 +01:00
Jacques Le Roux b06521c356 Fixed: fixes wrong wiki URLs 2021-02-22 11:44:17 +01:00
Jacques Le Roux 26a2be1392 Fixed: Wrong heading on creating quote under order component (OFBIZ-11221)
Steps to re-generate :

1. Login with the username and password.
2. Go to order component order.
3. Click on Quotes
4. Click on new quotes

Error: Edit quote is shown on the place of New quote.
Actual: New quote should be shown on the place of edit quote on UI.

Thanks: jai kumar raghuwanshi for report, Pradyum Dharwa  for 1st patch,
Ratnesh Upadhyay for better suggestion and Ankit Joshi for the patch
2021-02-20 13:29:21 +01:00
Jacques Le Roux a0b2f55b40 Fixed: Bypass Java GString to String conversion in ObjectType::simpleTypeOrObjectConvert (OFBIZ-12182)
Follows https://markmail.org/message/azn7e4g2rbpo7tvj

Conflicts handled by hand
 framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
2021-02-19 09:38:50 +01:00
Wiebke Pätzold 7add713a10 Fixed: Financial account transaction (OFBIZ-10308)
Fixes the direction of some accounting transactions.

Thanks Ingo Wolfmayr for the patch
2021-02-15 19:50:21 +01:00
Michael Brohl 315bdea44b Fixed: Unable to add product (of ASSET_USAGE type) in order
(OFBIZ-10791)

The patch was manually applied due to conflicts/renamed ressources.

Thanks Priya Sharma for providing the patch.
2021-02-15 18:23:03 +01:00
Jacques Le Roux a1e495de19 Fixed: issue put in with r1160964 (9 years, 5 months ago)
Fixes a syntax issue spotted while testing FreeMarker 2.3.31
2021-02-13 18:08:33 +01:00
Jacques Le Roux 4a26aecbf5 Fixed: Use from-field pattern instead of value=${***} pattern in 'set' element (OFBIZ-9607)
Fixes a syntax issue spotted while testing FreeMarker 2.3.31
2021-02-13 18:08:32 +01:00
Suraj Khurana a5e96763e4 Fixed: ViewQuoteProfit shows fields in wrong order.
(OFBIZ-11680)
Thanks Pierre for reporting and Lalit Dashora for providing the patch.
2021-02-12 11:12:17 +05:30
Jacques Le Roux 00200bfaca Fixed: Adds a blacklist (to be renamed soon to denylist) in Java serialisation (OFBIZ-12167)
Adds an example based on RMI which is known to be a problem
2021-02-09 09:59:17 +01:00
Jacques Le Roux bbc63bc470 Fixed: Ampersand in Party not displayed correctly (OFBIZ-12140)
In the reported case, ModelFormField::getDescription double HTML encodes the
description when both the entity and the description contain an ampersand.

A solution is to test if the description is already HTML encoded before encoding
it again. If HTML encoded then only String encodes it.

BTW I'm not sure it's useful but it's harmless, the same solution can be applied
to OFBIZ-12026 and similarly in renderableFtlFormElementsBuilder::encode. I'll
do as improvements...

Thanks: Andrew Waters for report and help in analysis
2021-01-23 17:50:03 +01:00
Jacques Le Roux e1d57fba00 Fixed: Creating a new Customer create a wrong record in CommunicationEvent (OFBIZ-12142)
In https://markmail.org/message/pf3d3qyjfucicbj7 I initially answered:
In demo data 13 parties use <<infoString="ofbiztest@example.com">> as in
<ContactMech contactMechId="FRA01" contactMechTypeId="EMAIL_ADDRESS" infoString="ofbiztest@example.com"/>
This one is loaded last. Rather
<ContactMech contactMechId="Company" contactMechTypeId="EMAIL_ADDRESS" infoString="ofbiztest@example.com"/>
which is the 1st one, should be loaded last.

A better solution is to use "ofbizsupport@example.com" in EmailServices.xml

Indeed, fortunately the Company party also uses this infoString and using it in
EmailServices.xml does not affect the integration test and should not affect
other parts of the (only) demo data

Thanks: Emad Radwan for opiniated report :) and Pritam Kute for issue analysis
2021-01-18 20:14:44 +01:00
Deepak Dixit 24d9328cdf Fix: Corrected the tika-parsers dependency version, also remove redundant entry for tika-core. This should fix the build failure (OFBIZ-12100) (#248)
Thanks Alexander Tzvetanov for reporting the issue
release17.12.05
2020-12-31 15:59:28 +05:30
Jacques Le Roux 2d15771d56 Fixed: partymgr fails to upload image (OFBIZ-12101)
This is a bug due to OFBIZ-12080, fileToCheck is the complete name of the file
with path not the filename

Thanks: Wai for report
2020-12-26 09:08:04 +01:00
Jacques Le Roux d13264b584 Improved: Remove hardcoded product category on CategoryWorker.getCatalogTopCategory (OFBIZ-12078)
When you call the java function
org.apache.ofbiz.product.category.CategoryWorker.getCatalogTopCategory()
the catalog returned if the system failed found it is hardcoded and don't use an
existing property : catalog->top.category.default

Thanks: Nicolas

Conflicts handled by hand:
applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryWorker.java
2020-12-25 17:04:59 +01:00
Jacques Le Roux aa4791f120 Fixed: Unique form names for promo actions (OFBIZ-12082)
Creating a promo with multiple rules and actions results in an exception.

It's reproducible by creating a promo with 1 rule and more than 1 Action and
specifying different products for each Action. When creating the second Action
and trying to specify another product to included the ajax request LookupProduct
will fail because it included both product ids in its xhr request.

Thanks: Danny Trunk
2020-12-25 16:18:37 +01:00
Jacques Le Roux e87747dcb9 Fixed: Issue in creating promotion action (OFBIZ-11168)
The issue reported there was fixed with OFBIZ-11058.

But there was still an issue in logI reported in a comment.

The problem was that
<#assign productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true)>
was used in 2 places where it should not have been because it returned a null
value that can't be handled by OFBiz.

Better use
<#assign productPromoActionCustomMethod = productPromoAction.getRelatedOne("CustomMethod", true)>
and
productPromoAction.getRelatedOne("ActionEnumeration", true))??

The repercussion was that the description was not used but the Id and the log
was showing an error.

Conflicts handled by hand:
applications/product/template/promo/EditProductPromoRules.ftl
2020-12-25 16:12:24 +01:00
Jacques Le Roux 3982f8d526 Fixed: Make ruleName field in PriceForms.xml#AddPriceRules safe (OFBIZ-12098)
I noticed an issue due to entity-auto. Unlike with a standard service you can't
protect fields using allow-html="safe" except by overriding fields. So in case
this must be done one by one...

An example is ruleName field in PriceForms.xml#AddPriceRules with
createProductPriceRule and updateProductPriceRule services

This fixes this only case...
Also removes trailing blanks and only that (by IDE setting)

Conflicts handled by hand
applications/product/servicedef/services_pricepromo.xml
2020-12-20 11:07:27 +01:00
Jacques Le Roux 540f5c80cd Fixed: Post-auth XSS vulnerability at catalog/control/EditProductPromo (OFBIZ-12096)
Prevents issues with integration tests

Conflicts handled by hand:
framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
2020-12-19 20:45:40 +01:00
Jacques Le Roux 637e02978c Fixed: Post-auth XSS vulnerability at catalog/control/EditProductPromo (OFBIZ-12096)
We missed to unescape EcmaScript encoded strings in
UtilCoded::checkStringForHtmlSafe, ie in all form fields using allow-html="safe"

Thanks: 牛治 <niu.zhi@zte.com.cn> for report

Conflicts handled by hand => no functional changes in code (ude to IDE setting)
framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
2020-12-19 18:20:45 +01:00
Jacques Le Roux 363e0be770 Fixed: Secure the uploads (OFBIZ-12080)
According to https://s.apache.org/rpzog, adds few, maybe redundant, Java
API/methods found in webshell, or alike, source code
2020-12-14 19:01:31 +01:00
Jacques Le Roux ba6470b9ea Fixed: Secure the uploads (OFBIZ-12080)
Follows OWASP advice on file names:

All the control characters and Unicode ones should be removed from the filenames
and their extensions without any exception. Also, the special characters such as
“;”, “:”, “>”, “<”, “/” ,”\”, additional “.”, “*”, “%”, “$”, and so on should be
discarded as well.

If it is applicable and there is no need to have Unicode characters, it is
highly recommended to only accept Alpha-Numeric characters and only 1 dot as an
input for the file name and the extension; in which the file name and also the
extension should not be empty at all
(regular expression: [a-zA-Z0-9]{1,200}.[a-zA-Z0-9]{1,10}).

So if someone needs other chars in uploaded filenames a change will be needed
2020-12-14 16:52:00 +01:00
Jacques Le Roux 00d875251c Fixed: Secure the uploads (OFBIZ-12080)
Prevents too long filenames as recommended by OWASP.

Based on https://security.stackexchange.com/questions/46484/denial-of-service-when-uploading-a-file#answer-46495
I decided to not limit sizes of files. Anyway we know it's only post-auth...
2020-12-14 12:48:49 +01:00
Jacques Le Roux 71ff63a043 Improved: Gradle logging hygiene (OFBIZ-12085)
Some times ago, we were forced to stop and quickly restart the demos because of
the Gradle daemons logging taking all the place; though we don't use Gradle
daemons in demos. Weird isn't ?

The reason is that by default org.gradle.logging.level=lifecycle is verbose.
Anyway, all org.gradle.logging.level are verbose. I mean they also duplicate
OFBiz information, have a look into your own Gradle daemon dir!

And that even if you don't use daemons, as we do for demos. Because Gradle
always uses at least 1 daemon to run.

So I was looking for a solution to not uselessly clutter the VM disk demos and
stumbled upon <<Gradle logging hygiene - Issue #2688>> - gradle/gradle (github.com)

This uses Evgeny Naumenko's solution at
https://discuss.gradle.org/t/gradle-daemon-produces-a-lot-of-logs/9905

I backport because it's needed by demos

# Conflicts:
#	build.gradle

# Conflicts:
#	build.gradle
2020-12-11 18:01:29 +01:00
Jacques Le Roux ce2f66b720 Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)
When we use any title with special characters for hyperlink tag, it shows broken
string on UI, eg:
<hyperlink description="${uiLabelMap.CommonImportExport}"  target="ImportExport">
should render a button with the title "Import/Export. But it shows as
Import&#x2f;Export

jleroux: I have noticed that the same happens with special French characters.
So it's a general issue.
The title (description in code) is HTML encoded and that does not work for
special characters. I simply used a string encoder.

Thanks: Pradeep Choudhary for report, Sourabh Jain for a possible but not
general solution at OFBIZ-12023, ie using target-type="plain"
2020-12-11 13:43:15 +01:00
Jacques Le Roux aaed04d7c8 Fixed: Label issue on List Companies page (OFBIZ-12023)
Navigate to URL: 'accounting/control/ListCompanies'
Under the companies list, the 2nd column has button for account
The System is not showing proper label in French.

This issue is occurring due to the hyperlink title is not supporting character
encoding for special characters. Please track progress under OFBIZ-12026.
2020-12-08 09:39:30 +01:00
Jacques Le Roux 13001ee048 Fixed: Secure the uploads (OFBIZ-12080)
module should be MODULE in SecuredUpload class

Improves: add adio adn video to supported file formats in security.properties

# Conflicts handled by hand
#	framework/security/config/security.properties
2020-12-07 19:46:11 +01:00
Jacques Le Roux e50ad56bb9 Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
As explained at
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
this is only an help for the users (ie not a security feature), but an
appreciable one easy to implement.

Here we start with website/WebSiteCMSContent.ftl
Also add some missing file extensions
2020-12-07 18:34:45 +01:00
Jacques Le Roux 7ff8fb814e Fixed: Secure the uploads (OFBIZ-12080)
Handles audio and video formats supported by Tika.

Adds few new audio and video formats in seed data.

AFAIK there are no ways to embed a webshell in an audio or video file. So I did
not sophisticate the validation, just rely on Tika.

I have also fixed bugs in SecuredUpload: in isValidSvgFile and
isValidImageIncludingSvgFile
2020-12-07 15:11:21 +01:00
Jacques Le Roux dc57528fd4 Fixed: Secure the uploads (OFBIZ-12080)
Improves the labels names and format comment in LayoutEvents.java

I backport to ease later works...
2020-12-06 11:18:26 +01:00
Jacques Le Roux 57c15f615d Fixed: Secure the uploads (OFBIZ-12080)
Replaces RESOURCE by resource, doh!
2020-12-06 11:11:07 +01:00
Jacques Le Roux 9d3631e278 Fixed: Secure the uploads (OFBIZ-12080)
validateUploadedFile() fixes another case reported in August by Harshit

Conflicts handled by hand
applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
2020-12-06 10:20:21 +01:00
Jacques Le Roux 983f4b95ae Fixed: Secure the uploads (OFBIZ-12080)
org.apache.xmlgraphics:batik:1.13 does not include batik-svg-dom it's in
batik:batik-svg-dom:1.6-1.

It's also in org.eclipse.birt.runtime:viewservlets:4.5.0 that's why it worked
only with plugins
2020-12-02 10:04:05 +01:00
Jacques Le Roux f741bb2277 Fixed: Secure the uploads (OFBIZ-12080)
2020/08/10 the OFBiz security team received a security report by Harshit Shukla
<harshit.shukz@gmail.com>, roughly it was (quoting part of it to simplify):

<<I have identified a Remote Code Execution (RCE) Vulnerability. The reason
behind this RCE is lack of file extension check at
catalog/control/UploadCategoryImage?productCategoryId=CATALOG1_BEST_SELL&pload_file_type=category>>

Using this post-auth RCE in OFBiz demos, Harshit was able to get some AWS
credentials by uploading a webshell (based on [0]).
By security, it was then decided by the Infra and OFBiz security teams to shut
down the demos.

After discussing the elements reported with Mark J Cox (VP of ASF security team)
we in common decided that no CVE was necessary.

# Conflicts handled by hand in R18:
#	applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
#	applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
#	applications/product/groovyScripts/catalog/category/EditCategory.groovy
#	applications/product/groovyScripts/catalog/config/EditProductConfigItemContent.groovy
#	applications/product/groovyScripts/catalog/imagemanagement/ImageUpload.groovy
#	applications/product/groovyScripts/catalog/imagemanagement/SetDefaultImage.groovy
#	applications/product/groovyScripts/catalog/product/EditProductContent.groovy
#	applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java
#	applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
#	applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
#	applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
#	build.gradle
#	framework/base/src/main/java/org/apache/ofbiz/base/util/FileUtil.java
#	framework/base/src/main/java/org/apache/ofbiz/base/util/HttpRequestFileUpload.java
#	framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
#	framework/security/config/security.properties

# Conflicts handled by hand in R17:
#	applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
#	applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
#	applications/datamodel/data/seed/ContentSeedData.xml
#	build.gradle
#	framework/base/src/main/java/org/apache/ofbiz/base/util/HttpRequestFileUpload.java
2020-12-01 10:14:48 +01:00
Jacques Le Roux f6176dba99 Fixed: Label issue on List Companies page (OFBIZ-12023)
Navigate to URL: 'accounting/control/ListCompanies'
Under the companies list, the last column has button for import export.
The System is not showing proper label.

This issue is occurring due to the hyperlink title is not supporting character
encoding for special characters. Please track progress under OFBIZ-12026.

Thanks: Lalit Dashora for report, sourabh jain for patch, Daniel Watford for test
2020-11-30 12:03:17 +01:00
Girish Vasmatkar 2a30d57118 Fixed: Discouraged use of variable to store command with paramaters because of wordsplitting issue
and instead used complete command for wget .(OFBIZ-12066)
2020-11-30 16:26:41 +05:30
Saurabh Dixit 91de16a55c Fixed: Single product tile is displayed on one row in product search. (OFBIZ-12045) (#245)
Cause: Wrong use of bootstrap grid classes.
Fix: Used row class as a parent to col-* class while rendering the products.
2020-11-30 11:40:43 +01:00
Jacques Le Roux e1cfe58828 Fixed: Edit button(s) are shown for shipments received or shipped (OFBIZ-11788)
When a shipment has been received (purchase) or shipped (sales), the shipment
process should be concluded. And thus the shipment should not be editable anymore.

Thanks: Pierre Smits for report, Ankit Joshi for patch
2020-11-29 20:43:10 +01:00