Backport e4919d16ca from trunk
Removes the localhost (and 127.0.0.1) OOTB.
Allows to use it through a "multi-property" (list) in security.properties.
Conflict handled by hand in security.properties
Backport 2aa68dc4de from trunk
When you have a user with long password (greater than 256 characters) present in OFBiz and you try to log with, OFBiz return a long error message with sensitive information due to exceeding value size to store on the field UserLoginHistory.passwordUsed.
To solve this we don't return any information on the genericValue that failed and analyze the field passwordUsed to escape the case where the password set to login is create than the database field capacity.
Thanks to Daniel Elkabes <daniel.elkabes@whitesourcesoftware.com> and Hagai Wechsler <hagai.wechsler@whitesourcesoftware.com> from white source software to raise the problem.
Problem when trying to access Party linked to Catalog.
When you click on a user associated with a catalog, the framework sends you to
party manager, but it's the currently logged in user that shows up in the
party manager, not the party that you want to see.
To reproduce, just go in the Catalog app, then on Catalogs, add a user to a
catalog, and try to access it via the button.
It comes from the fact that the parameter sent to the party manager via the
link doesn't have the right syntax.
Thanks: Gaetan Chaboussie
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)
I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:
https://s.apache.org/vhlbjhttps://s.apache.org/nyndk
IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.
The issues can be fixed with something like the following:
byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);
jleroux: this prepends the IV in order to decrypt the plaintexts. It's similar
to what has been done for the DesCrypt class. But contrary to the DesCrypt class
I did not test.
Thanks: Artem Smotrakov
Conflicts handled by hand (a lot)
ValueLinkApi.java
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)
I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:
https://s.apache.org/vhlbjhttps://s.apache.org/nyndk
IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.
The issues can be fixed with something like the following:
byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);
jleroux: we prepend the IV in order to decrypt the plaintexts. I'll do
something similar in ValueLinkApi class ASAP
Thanks: Artem Smotrakov
Conflicts handled by hand:
framework/base/src/main/java/org/apache/ofbiz/base/crypto/DesCrypt.java
As WorkEffort entities with type as `Task' and a non-empty `Estimated Start Date'
will be included in calendar page, so TASK_STATUS should be added to EditCalEvent,
to make task status be correctly displayed and updated.
1. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/EditWorkEffort
2. Create a WorkEffort with Type as Task, Status as [Task] Accepted,
and select Now for Estimated Start Date
3. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/calendar
4. Selected newly added task entry in calender, to show the edit form
In step 4, task status will be shown as In Planning, instead of Accepted.
Thanks: Xin Wang
CVE-2021-31811: A carefully crafted PDF file can trigger an OutOfMemory-Exception
while loading the file. This issue affects Apache PDFBox version 2.0.23 and prior 2.0.x versions.
CVE-2021-31812: a carefully crafted PDF file can trigger an infinite loop while
loading the file. This issue affects Apache PDFBox version 2.0.23 and prior 2.0.x versions.
When trying to add a note to WorkEffort entity, I found that URL encoded
characters are unescaped, which is not expected.
e.g.:
1. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/EditWorkEffortNotes?workEffortId=TASK01
2. Add a note with content: https://example.com/a%20link
3. After submission, it will turned to be: https://example.com/a link
Thanks: Xin Wang for report and exchanges until solution I provided
Conflicts:
UtilHttp.java:
removes unused OOTB checkURLforSpiders for simplification
removes number of cases in setResponseBrowserDefaultSecurityHeaders
not present in R17
If `sanitizer.enable` is turned off, `ListWorkEfforts` form will be vulnerable
to XSS attack, because of incomplete escaping.
Steps to reproduce:
1. Turn off `sanitizer.enable` in owasp.properties
2. Create a WorkEffort entity with name as `<script>alert(1)</script>`
3. Go to page: http://localhost:8080/workeffort/control/FindWorkEffort
4. Search for "Work Effort Name" which contains "script"
Thanks: Xin Wang
In FindWorkEffort page, "Work Effort Name" can be specified as search
option, but the result table do not show it.
It would be nice if WorkEffort names can be displayed. Actually,
'workEffortName' has already been added to the description of hyperlink
in 'workEffortId' field, but 'workEffortName' is not presented in
'fieldList', so names are failed to be shown.
Thanks: Xin Wang
When trying to update child work effort, a SQL error is reported:
Column 'WORK_EFFORT_ID' cannot accept a NULL value.
Steps to reproduce:
1. Open : workeffort/control/ChildWorkEfforts?workEffortId=TASK01&trail=TASK01
2. Select a child work effort
3. Modify the name and click "Save"
related to OFBIZ-753, workEffortId is also duplicated in edit form, If I
comment out workEffortId field of EditWorkEffortAndAssoc, it works properly.
Thanks: Xin Wang for report and Scott for initial workaround in OFBIZ-753
- Since the method InvoiceWorker.getInvoiceTotal takes care of the conversion, it is redundant to convert it again on the screen, which results in mismatch of the currency and the amount.
Thanks: Suraj, Jacques, Rajadurai for the review and Andrei Stan for reporting.
When creating a plugin via gradle :
./gradlew createPlugin -PpluginId=plugin-test -PpluginResourceName=PluginTest
-PwebappName=plugin-test -PbasePermission=PLUGIN_TEST
and loading all the required data and permissions, the plugin doesn't appear
in the menu.
It comes from the ComponentConfig.java file, L1229, when the permissions gets
trimmed and modified. I tried removing it locally and it fixed the problem.
Thanks: Gaetan Chaboussie
There is no "basePrice" resulting from calculatePurchasePrice service calling but
a simple "price".
This was put in with d04f777 commit and OFBIZ-11955
Thanks: Woyce Batkins for report
The checksum part was missing in Windows init-gradle-wrapper.ps1 script
I have noticed 2 points:
1. We should use SHA256, not SHA1
2. The unix-like shell script in OFBiz misses checksum verification in case
shasum command is not installed. In other words, if I launch the script it would
fail with "shasum not found, the downloaded files could not be verified".
However, the file will be kept there, so the user could launch unverified jar.
Last point was reported by Vladimir Sitnikov at LEGAL-288
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an OUT
contactMechTypeId paramter and the call on this end has not been modified."
jleroux: I fixed lines too long
File PartyServices.java
Error Description Line
La ligne excède 150 caractères (trouvé 178). 2621
La ligne excède 150 caractères (trouvé 178). 2638
La ligne excède 150 caractères (trouvé 191). 2655
Conflicts handled by hand
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175,
"createPartyContactMech Service has been changed to expect an
OUT contactMechTypeId paramter and the call on this end has not been modified."
Conflicts handled by hand in PartyServices.java
I let the changes coming from trunk, too much to revert by hand
In SafeObjectInputStream.properties
Renames listOfSafeObjectsForInputStream to allowList and fixes it
Introduces a denyList
Adapts SafeObjectInputStream class to new denyList
Conflicts handled by hand
framework/base/config/SafeObjectInputStream.properties
framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
Prevents generics markup in string type names.
Conflict handled by hand
framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
This removes the inoffensive but annoying message in log (which does not show in
trunk, see https://github.com/apache/ofbiz-framework/commit/27c9180/
Not the same as in trunk, simply handling with exception Rather than returning
null, also shorten java.rmi.server to java.rmi to block more cases
Replaced logic to ajaxify the response from EditEmplPosition with navigating user to EditEmplPosition page.
When we are getting the entire page and updating it into the DOM, it would be better if we navigate user to the page.
Issue with the current approach is current page and the EditEmplPosition page both have GlobalActions decorator all the js files in GlobalActions are loaded twice. Either we should ajaxify a section of page or we should navigate user to the EditEmplPosition page.
Thanks Pierre Smits for reporting the issue and Sebastian Berg, Michael Brohl, & Jacques Le Roux for the discussion and efforts
The SOAP and HTTP engines are open doors to security issues.
At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out
as we did for RMI in the past.
Of cause it must be clearly documented how to use them if needed.
Here is the email content:
After the recent fix for the CVE-2021-26295[1] we discussed with the security
team about the opportunity need to comment out the SOAP and HTTP engines
like we did in the past for RMI[2], this obviously for security reason.
[1] OFBIZ-12167 "Adds a blacklist (to be
renamed soon to denylist) in Java serialisation (CVE-2021-26295)"
[2] OFBIZ-6942 "Comment out RMI related
code because of the Java deserialization issue [CVE-2016-2170] "
I just put a small comment in webtools controller, it should be enough.
The tests pass
The addImageForProduct process is not directly uploading a file but renames it
before.So there is a hyphen, and possibly a pair or parenthesis in case of
duplicate files, added to the file name.
In this commit I have also added the possibility to use underscores and spaces
in the original filename
1. Navigate to URL: accounting/control/IncomeStatement?organizationPartyId=Company
2. In income statement section click on export as csv button.
3. The exported csv has correct balance but with invalid currency symbol.
4. On screen USD $ symbol is shown and in csv some other currency symbol is shown.
Thanks: Lalit Dashora for report, Praveen Sharma for the fix
That's for (low) security reason. There are no bugs in R17 and R18 but after
reading about FREEMARKER-124 at
https://freemarker.apache.org/docs/versions_2_3_30.html
I believe we should update update Freemaker to 2.3.31 in R17 and R18
Like for createGlReconciliation at OFBIZ-10675 it must be that this has never
been tested nor used by anybody. In relation with OFBIZ-10675, took me hours to
understand that it was only missing an INOUT instead of a simple IN :/
https://demo-trunk.ofbiz.apache.org/accounting/control/createGlReconciliation
When entering an amount and submitting the data an error is thrown.
jleroux:
EditFinAccountReconciliation form extends EditGlReconciliation. There
glReconciliationId and reconciledBalance fields are already present.
So adding them in EditFinAccountReconciliation is wrong. On the other hand the
display of reconciledBalance is better in EditFinAccountReconciliation.
So I moved it there.
Thanks: Pierre Smits for report and Mohammed Rehan Khan for initial patch
See accounting/control/EditFinAccountReconciliations?finAccountId=ABN_CHECKING
Removes the unwanted condition to include duplicate reconciledBalance filed
which was the cause of the issue.
Thanks: Pierre Smits for report, Mohammed Rehan Khan for the fix
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 initial fix, Jacques for the test.
Updates init-gradle-wrapper.bat
to exit if Gradle wrapper already exists
to start PowerShell (>=7) in admin mode, this to be able to use Set-ItemProperty
Updates init-gradle-wrapper.ps1
to removes exit if Gradle wrapper already exists
to create the gradle/wrapper dir if necessary
to handle the ConstrainedLanguage mode if necessary
(OFBIZ-12192)
Changed script to use the proper Gradle wrapper version. Changed the
download url from Bintray to Gradle GitHub repository and removed the
backup link.
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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...
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
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/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"
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.
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
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
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
validateUploadedFile() fixes another case reported in August by Harshit
Conflicts handled by hand
applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
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/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
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
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
This is a bug because the behaviour is not assured on Windows for instance. So
it's impossible to correctly develop and test.
As explained at
https://docs.oracle.com/javase/8/docs/api/java/io/File.html#renameTo-java.io.File-
<<Many aspects of the behavior of this method are inherently platform-dependent:
The rename operation might not be able to move a file from one filesystem to
another, it might not be atomic, and it might not succeed if a file with the
destination abstract pathname already exists. The return value should always be
checked to make sure that the rename operation was successful.
Note that the Files class defines the move method to move or rename a file in a
platform independent manner.>>
So the expression
file.renameTo(file1)
used in 5 Application Product Groovy scripts can be easily replaced by
Path source = file.toPath()
Files.move(source, source.resolveSibling(filenameToUse))
that is working on all platforms as explained at
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#
move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-
Shuibo Ye <shuiboye@gmail.com> reported a possible arbitary file write using
webtools/control/EntitySQLProcessor.
In the "SQL Command" part, I create a table and insert some strings and
export the table to a file one sentence at a time.
PoC: CREATE TABLE "test" (string VARCHAR(80))
INSERT INTO "test" (string) VALUES ('<%= system.getProperty("user.dir") %>')
call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null,'test','.\framework\webtools\webapp\webtools\default.jsp',null,'*',null)
After executing the three sentences,I successfully write the file and its url
is https://localhost:8443/webtools/default.jsp.
I fixed it preventing execution on SYSCS_UTIL.SYSCS_EXPORT_TABLE and JSP, more
could be added if necessary
This was reported to the security team by Shuibo Ye <shuiboye@gmail.com>.
We did not create a CVE because it's a post-auth "vulnerability"
Thanks: Shuibo Ye
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
For this issue (OFBIZ-8302) I reverted the point 1 of
http://svn.apache.org/viewvc?view=revision&revision=1759555
As reported by Alvaro Munoz from GH security team it's not sufficient:
<<the second part of the fix was not effective, since the attacker can close the
raw string context with a double quote and write a new attribute or even close
the macro tag and write arbitrary FreeMarker code.>>
So this removes the 2nd part and add better solution to fix the OFBIZ-8302 issue
The solution is to encode only the QueryString and to handle it correctly in
UtilHttp::getParameterMap. I must say it was not a sinecure!
# Conflicts:
# framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
# framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
The variant products' images are being saved in the variable IMG encoded as urls,
thus selecting the variant triggers an image override with an unsuitable file name.
Thanks: Alex Bodnaru
Backport build.gradle correction from OFBIZ-12035, correction in generateAllPluginsDocumentation to put copy of OFBiz-Logo in doFirst to avoid it's run during gradle Configure project
(OFBIZ-11971)
As we have returnItemTypeId as RET_MISC_ADJ, same should be used in ReturnItemTypeMap and corresponding InvoiceItemTypeMap.
Thanks Amit Gadaley for reporting and providing the patch.
This MessagingException issue is with sendFrom, please refer the the code blocks from minilang and groovy versions below,
<!-- find email address for currently logged in user, set as sendFrom -->
<entity-and entity-name="PartyAndContactMech" list="curUserPartyAndContactMechs">
<field-map field-name="partyId" from-field="userLogin.partyId"/>
<field-map field-name="contactMechTypeId" value="EMAIL_ADDRESS"/>
</entity-and>
<first-from-list list="curUserPartyAndContactMechs" entry="curUserPartyAndContactMech"/>
<string-append field="sendEmailMap.sendFrom" string="${curUserPartyAndContactMech.infoString}" prefix=","/>
There should not be a prefix, there is always only 1 sender
sendOrderDeliveryScheduleNotification was also affected
Thanks: Mridul Pathak for analyse
After removing the temporary diles in generateAllPluginsDocumentation
this removes them also in generatePluginDocumentation.
Despite that they still appear after simply running gradlew ofbiz (without any
change), I mean:
ofbiz-framework\plugins\birt\src\docs\asciidoc\images\OFBiz-Logo.svg
ofbiz-framework\plugins\ebay\src\docs\asciidoc\images\OFBiz-Logo.svg
ofbiz-framework\plugins\ldap\src\docs\asciidoc\images\OFBiz-Logo.svg
ofbiz-framework\plugins\myportal\src\docs\asciidoc\images\OFBiz-Logo.svg
ofbiz-framework\plugins\projectmgr\src\docs\asciidoc\images\OFBiz-Logo.svg
ofbiz-framework\plugins\solr\src\docs\asciidoc\images\OFBiz-Logo.svg
I have no ideas why :/
Files like birt/src/docs/asciidoc/images/OFBiz-Logo.svg, in many plugins,
don't get removed on clean.
I simply missed to clean them in pluginAsciidoc Gradle task (OFBIZ-10677)
Thanks: Alex Bodnaru for report
It seems that we are getting the issue due to the special character "/" which is
present in OrderManager Uilabel.
I just changed the OrderManager Uilabel value from Buy / Sell Order Manager to
Order Manager and removed the special character "/".
Thanks: Mohammed Rehan Khan
Thanks to Alvaro's explanations, the problem was in MacroFormRenderer where, for
lookups, we retrieve _LAST_VIEW_NAME_ as a parameter without encoding it.
Got hard conflicts, all done by hand.
Thanks: Alvaro for advice
Changes made in startsWith and indexOf methods in ContentManagementServices
for OFBIZ-9254 where wrong (reversed). Fortunately only place where this happened.
I added a comment to make clear why we have 2 empty else if
I'll backport later, conflicts to handle by hand...
Thanks: Ankush Upadhyay for spotting the bug
Conflicts handled by hand
On orderview screen at the ordermgr, when a user tries to change the status of
the order, in OrderInfo.ftl, we are calling "changeOrderStatus" request as
<@ofbizUrl>changeOrderStatus/orderview</@ofbizUrl>
Hence when the request is done, it is rewriting URL to
https://localhost:8443/ordermgr/control/changeOrderStatus/orderview.
When js functions running in the backend like "getAssociatedStateList" are
called, they are getting the wrong URL to send a request to. This was causing
the issue.
For now, there are two different fixes that can handle both problems which are
mentioned in OFBIZ-2562 and OFBIZ-11838.
1.
To change the request mapping for "changeOrderStatus" and add request-redirect
to "orderview" screen. Change the actions in the forms in OrderInfo.ftl to
call "changeOrderStatus" request only and then remove code in
"getAssociatedStateList" js function to rewrite URL.
2.
To add .length to the existing URL rewrite code written in
"getAssociatedStateList" js function as
if (jQuery('#orderViewed').length) {
requestToSend = "/ordermgr/control/getAssociatedStateList"
}
Thanks: Pritam Kute!
I picked the 2nd solution
When creating event for the party other than the loggedin user, the party should be in CAL_OWNER role to be added to event. Added appropriate check in service along with the error message.
Thanks Rubia Elza Joshep for reporting the issue and Aditi Patidar for providing the patch
We have added a Gradle plugin com.github.jakemarsden.git-hooks which install pre push hook on developer machine, but due to limitations of checkstyle plugin with the Gradle version of release 17.12 these changes cannot be backported. Once the hook is installed it is difficult to remove the hook when branch changes. With the absence of checkstyle plugin, the hook fails when pushing code. To avoid such failures added a dummy task with the same name.
We have AsciiDoc files in main repo and it would be better to have them also in
HTML format under the web site: https://ci.apache.org/projects/ofbiz/site
For that a new generateReadmeFiles is needed and new "readme" locations under
each of https://ci.apache.org/projects/ofbiz/site "sub-dirs".
We can create those from Buildbot like we did with INFRA-20311
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.
(OFBIZ-10174)
With Rainbow theme, even in large screens, a scrollbar appears at bottom where
it's useless.
The CSS which is adding a border-right on the application bar is adding extra
1px width causing this issue. Attached the patch to remove extra width for the
same.
Changes made by hand
https://demo-stable.ofbiz.apache.org/ecommerce/control/order.pdf?orderId=WSCO10000
In the above URL, the parameter 'orderId' has the value 'WSCO10000' and after
incrementing the value to 'WSCO10001' or 'WSCO10002' will download the receipt
of other orders which have been placed by other users.
All the available order receipts can be downloaded by running an automated tool
(Burp Intruder) on the parameter 'orderId=WSCOXXXXX'
I have successfully tested this by using 2 different accounts: DemoCustomer and
DemoCustomer2
An attacker can download order receipts of other users and this could lead to
information disclosure.
The only real solution to this issue is to implement access control. The user
needs to be authorized for the requested information before the server provides
it.
Thanks: Harshit Shukla [mailto:harshit.shukz@gmail.com]reported this IDOR
vulnerability to the OFBiz security team, and we thank him for that.
It's reproductible on trunk demo though only visible in log, UI shows no issue
R17 and R18 are also affected, R16 is OK.
Ankush: This stacktrace should be coming for all entities where
default-resource-name is defined on entity definition but no property exist in
defined resource for key EntityDescription.entityname and FieldDescription.field.
As we want to have these entity labels as much as possible, we can simply print
warning about the missing entity descriptions and field descriptions for
readability purpose instead of printing huge exceptions stacktrace.
Thanks: Ankush Upadhyay and Pierre Smits for the help
Handled by hand (swallowing exceptions is lazy and bad :p)
In .gitignore in root ofbiz directory there is plugins/
so all directory plugins are ignored
if the line is replace by /plugins/ only root directory plugins is ignored
Thanks: Olivier
Conflict handled by hand
(OFBIZ-11796)
Instead of updating all product facilities records on one inventory item change, we should be changing only specific product facility record for that the inventory item belongs to. Thanks Jacques, Pierre, Pawan and Arun for the review.
(OFBIZ-9478)
Fixed missing Lookup controller entries for the following pages:
1. LookupBudget for Employment Applications page of party
2. LookupDataResource for Content page of facility
3. LookupFixedAsset for Inventory Items Details page of facility
Thank you Pallavi Goyal for reporting the issue and Humera Khan for providing the patch
The error is caused by an invalid expression, the two boolean evaluations should reside in the same groovy scriptlet.
Thanks, Pierre for report, Scott for the solution and Adrian, Jacques, Rahul for the review.
(OFBIZ-11691)
Following https://markmail.org/message/xi2bcvnmpdfvfgk2 discussion on dev ML
here is the file I suggest. If we are OK we can backport it to the supported
release branches. Of course I'm open to modifications...
Thanks for their answers: Deepak Nigam, Michael Brohl, Pierre Smits and
Taher Alkhateeb
(OFBIZ-11356)
Adding the missing showAll flag in the paginateOrder form because of which the orders were not shown while submitting the next button.
Thanks Michael Brohl for reporting the issue and Ankit Joshi for providing the patch
(OFBIZ-11716)
Because the 2 xmlrpc related requets in webtools (xmlrpc and ping) are not using
authentication they are vulnerable to unsafe deserialization.
thanks: Alvaro Munoz <pwntester@github.com> from the GitHub Security Lab team
(OFBIZ-11714)
In OFBIZ-10539, We missed removing the line which was adding parameters into the map as Ritesh suggested a good way to handle parameters. I've removed that redundant line of code and attaching a patch for the same.
(OFBIZ-11709)
This commit does 2 things:
Send a correct commit comment (kind of amendment, w/o push force)
Previous code compiled but SAFER_RESOLVER is not a class but a field, better KISS
Real change:
Better style with line not too long:
(OFBIZ-11709)
Some people may want to use another TemplateClassResolver than SAFER_RESOLVER
This creates a new templateClassResolver security property and uses it in
FreeMarkerWorker::makeConfiguration by default
Conflicts all handled by hand (no merge possible)
(OFBIZ-11709)
Since Freemarker 2.3.17 a known solution to these issues is to register a
TemplateClassResolver in Freemarker configuration in order to limit which
TemplateModels can be instantiated in the templates. The predefined resolver
SAFER_RESOLVER doesn't allow to instantiate the Execute class[4].
So the solution is to add the line
newConfig.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
in FreeMarkerWorker.java
(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.
(OFBIZ-11633)
When you upload a content from the party profile page you don't see a progress
bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong
Mohammad Kathawala mentionned that it was removed with OFBIZ-9299
It was also broken with OFBIZ-11402
Thanks: Mohammad for the track
Conflicts handled by hand
applications/party/template/party/profileblocks/Content.ftl
framework/common/groovyScripts/CommonServices.groovy
(OFBIZ-11573)
More details: Method getColumnLabel returns the designated column's suggested title for use in printouts and displays. Method getColumnName returns the designated column's name.
Thanks: Suraj and Jacques for the review.
(OFBIZ-11606)
Fixes "<**:condition" not well managed and generating an error
Changes all the getNodeName() by getLocalName() in the ModelX****Condition.java
Thanks: Olivier
(OFBIZ-11606)
rootElement is not correct for a compound file, it's necessary to do a
UtilXml.firstChildElement(rootElement, "forms"); to be correct.
It's done for screen, form but not for grid !
So correction is now added the correct read of rootElement.
jleroux: completely backported by hand
Thanks: Olivier
2020-04-27 15:08:40 +02:00
510 changed files with 5058 additions and 2742 deletions
The OFBiz install will be empty, there will be no chart of accounts, no transactions, no products, no customers and no suppliers.
You can't log to the E-Commerce Store. You will get: "A Product Store has not been defined for this ecommerce site. A Product Store can be created using the ofbizsetup wizard."
<CreditCardpaymentMethodId="AMEX_01"cardType="CCT_AMERICANEXPRESS"cardNumber="378282246310005"expireDate="02/2020"companyNameOnCard="Your Company Name"
<CreditCardpaymentMethodId="AMEX_01"cardType="CCT_AMERICANEXPRESS"cardNumber="378282246310005"expireDate="02/2120"companyNameOnCard="Your Company Name"
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.