When the webshop (ecommerce component) has been set up for retail (B2C), with
the tax setting 'Show prices with VAT tax included' set to 'Y' in store 9000
the appropriat Tax Auth Geo and Tax Auth set in store 9000
the flag 'Include Tax In Price' set to 'Y' for the Tax Auth
the price for a virtual product is shown including VAT.
However, for a selected variant the price shown is without VAT
Thanks: Pierre Smits to raise the issue and Priya Sharma for solved it
This much increases the current security by creating SecuredUpload::isValidText
and call it from ProgramExport.groovy
This said I agree with thiscodecc that a better solution would be to use a
Groovy sandbox, and not only in ProgramExport.groovy.
I had a quick glance at a such solution. Unfortunately as Cédric Champeau reports
at https://melix.github.io/blog/2015/03/sandboxing.html and unlike thiscodecc
suggest there are no "mature solutions on the market".
Nevertheless I'll have a deeper look at an OFBiz specific Groovy sandbox
solution.
Somehow related: I'll also soon extract the list of words used in
SecuredUpload::isValidText in a deniedWebShellWords property in security.properties
Thanks: thiscodecc for report
Conflicts handled by hand
framework/webtools/groovyScripts/entity/ProgramExport.groovy
When you call a groovy script from an event controller, some information are present note on the same place on the binding context.
Example if you call a groovy script as service you found the userLogin with parameters.userLogin or when you call it as event, the userLogin is on the binding context root.
The problem appear with the DSL method 'run service' who search the missing value need by a service (userLogin, locale and timezone) on the map parameters on the binding context, so failed to populate correctly the information for an event.
Call from event
Map serviceResult = run service: 'createInvoice', with: [partyId: partyId, invoiceDate: nowTimestamp]
Failed due to security issue : missing userLogin on the service context.
Fixes a number of issues I spotted while working on OFBIZ-12305 in relation with
OFBIZ-12055
The last change I made for OFBIZ-12305 was incomplete, the files could not be
checked by SecuredUpload because they did not exist! This concerns
ImageManagementServices, DataServices, FrameImage and ProductServices classes.
I used Files::createTempFile to fix that.
Also fixes a bug in SecuredUpload where I reversed the check on
fileToCheck.length in Windows case. I also added a comment, Windows 10 now
allows more length (need an OS parameter change though)
Finally, creates public SecuredUpload::isValidText to be used in OFBIZ-12305
Conflicts handled by hand
DataServices.java
The creation of a new company failed with constraint database error due to a missing functional General Ledger data.
To correct this, we separate the demo GlAccount demo data from Accounting demo data to allow it alone when we create the new company.
A second error can appear with the presence of a partyAcctgPreference if the validation isn't realized immediately, so we just add a control of the presence before call service createPartyAcctgPreference.
Thanks to Szabolcs Szekelyi for raise this issue and Jacques Leroux for its look
Safer completing solution as recommended by weinull orz <weinull@outlook.com>
Previous commit was OK, but better be safe than sorry ;)
Also forgot to commit the DENIEDFILEEXTENSIONS checkstyle change last time
Thanks: weinull orz for the the right suggestion (done 2021-08-13)
The fix I did is two folds:
filters extensions (thanks to Zhujie's suggestion of a list of extensions to ban)
deletes bad files at the right place (thanks to thiscodecc's report)
Thanks: thiscodecc for the security report
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
Menus link with request-confirmation and confirmation message do not generate the script that open confirmation
When you activate the following menu item :
<menu-item name="statusToCancelled" title="${uiLabelMap.AccountingPaymentTabStatusToCancelled}">
<link target="setPaymentStatus" request-confirmation="true" confirmation-message="You want to cancel this payment number ${payment.paymentId}?">
....
</link>
</menu-item>
OFBiz to not generate the js code link to the request-confirmation attribute because this functionality has been never implemented on java code for MenuRenderer
Thanks to Leila Mekika for raised this issue and solved it
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
UtilValidate.java: replaces DEFAULT_EMPTY_OK simply by true
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.
This is related to this question from Daniel at
https://github.com/apache/ofbiz-framework/pull/220
I couldn't figure out how to configure OFBiz with my Google API key so ended up
temporarily patching
themes/common-theme/template/includes/GeoLocation.ftl line 44 with my key.
Line 44 looked similar to:
<script src="https://maps.googleapis.com/maps/api/js?key=secret_google_api_key" type="application/javascript"></script>
Is there a way to configure ofbiz with the API key?
Disclaimer: w/o a not free "Google API key" I was not able to test, will ask
Daniel...
Conflicts handled by hand
framework/common/config/general.properties
(OFBZ-12246)
When editing date-time fields, they are truncated to the second. However
the default From Date field value of a Product Config Item Content is
stored in milliseconds. The From Date is a primary key of the config
item content and is used when finding the relevant record to update.
When the From Date field was editable on the Edit Product Config Item
Content content form, it would be truncated to the second and included
in the update request POST to the server. Since the From Date was
altered, the relevant record to be updated could no longer be found by
its primary key.
By making the From Date field display only, we prevent truncation of its
value meaning the record to be updated can be found.
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
asm select library is already replaced with select2 library, but the library files still exist in code base unused.
asm_asmListItemPercentOfForm varaible was used to set the width of the selected items which were displaced distictly from select fields. With select2, the selected items display inside the input field so it is no more needed
Thanks Jacques Le Roux for reporting it
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
When a dropship only (or dropship on low ATP) product with no qualified supplier
added to shopping cart and cart converted to sales order. System should return
errors and should not create sales order.
Thanks: Amit Gadaley
Conflicts handled by hand
ShoppingCart.java
and despite
Auto-merging applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
CheckOutEvents.java too