Commit Graph
26308 Commits
Author SHA1 Message Date
Nicolas Malin 7cc848cfab Improved: Mandatory contact number when create/update a TelecumNumber (OFBIZ-11110)
It's possible that create a Telecum number without contactNumber that appears as an inconsistency.

Thanks: Rashi Dhagat for this issue
2021-09-27 16:57:43 +02:00
Nicolas Malin 48ecfade8e Fixed: Incorrect price for selected variant shown (OFBIZ-12236)
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
2021-09-27 16:31:32 +02:00
Gil Portenseigne 523c25d0ba Improved: Create a deny list to reject webshell tokens (OFBIZ-12324)
Improve readability using stream api.
Fix deniedWebShellTokens property where some blank space where removed
and '// python' comment was inlined.
2021-09-23 10:49:30 +02:00
Jacques Le Roux 8b852ff612 Improved: Create a deny list to reject webshell tokens (OFBIZ-12324)
Extracts the list of words used in SecuredUpload::isValidText in a
deniedWebShellTokens property in security.properties
2021-09-20 18:14:50 +02:00
Jacques Le Roux 4da54af4e0 Fixed: Groovy Program sandbox bypass (OFBIZ-12305)
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
2021-09-17 18:52:01 +02:00
Nicolas Malin 16526428f2 Fixed: Groovy DSL failed to use 'run service' from an event call (OFBIZ-12322)
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.
2021-09-17 15:05:19 +02:00
Jacques Le Roux 0216f21f82 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
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
2021-09-17 11:41:37 +02:00
Jacques Le Roux 7f3e1f58c4 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
Fixes a typo issue
2021-09-13 09:56:03 +02:00
Jacques Le Roux d4297a1c29 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:42:43 +02:00
Jacques Le Roux 9b5c721c2a Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:16:01 +02:00
Jacques Le Roux 24c72edc4c Fixed: Found a new XXE (XML External Entity Injection) vulnerability in ArtifactInfo (OFBIZ-12306)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:16:00 +02:00
Nicolas Malin 5a90821bd8 Fixed: Setup instructions don't work (OFBIZ-12228)
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
2021-09-06 17:34:06 +02:00
Jacques Le Roux 4088e0a28e Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
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)
2021-09-03 16:50:53 +02:00
Jacques Le Roux d0b4f2d164 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
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
2021-09-03 13:48:05 +02:00
Jacques Le Roux 960cc0c1f1 Documented: Changes the link to issue tracker (Jira) to simplify things related to security 2021-09-01 09:55:28 +02:00
Jacques Le Roux 6e2c13a4eb Fixed: SecuredUpload::isValidTextFile wrong check with uppercase (OFBIZ-12301)
In SecuredUpload::isValidTextFile a wrong check is done

Thanks: Zhujie from Ping'an Technology
2021-08-10 13:03:39 +02:00
Jacques Le Roux 8fb8274144 Fixed: Wrong uploaded file checked in Image Management (OFBIZ-12297)
When I secured the uploads with OFBIZ-12080 I made a mistake and checked the
wrong uploaded file in Image Management.
2021-07-29 17:26:00 +02:00
Nicolas Malin 5944749ee0 Fixed: IndexOutOfBoundsException on Entity Import (OFBIZ-12273)
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.
2021-07-28 14:32:36 +02:00
Nicolas Malin 7a55ea8906 Fixed: UserLoginHistory failed the store operation with large password (OFBIZ-12287)
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.
2021-07-28 14:31:59 +02:00
Jacques Le Roux 56df90751e Improved: Adds missing ASL2 headers in Rainbow Stone less files 2021-07-27 17:03:42 +02:00
dshunter107 5955df1924 Update services_ledger.xml (#315) 2021-07-27 14:02:41 +02:00
Jacques Le Roux e95c6a529c Fixed: bug on button from catalog to party associated (OFBIZ-12289)
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
2021-07-23 12:55:58 +02:00
Jacques Le Roux ace168d329 Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(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/vhlbj
https://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
2021-07-23 09:29:07 +02:00
Jacques Le Roux bbc2d23f3a Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(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/vhlbj
https://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
2021-07-21 11:11:02 +02:00
Jacques Le Roux 8ec079fbfc Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo, hence the next
2021-07-20 07:38:34 +02:00
Jacques Le Roux fc96ffacca Fixed: Upgrades Tomcat from 9.0.43 to 9.0.48 (OFBIZ-12280)
Due to CVEs-2021-30037/30639/30640
2021-07-12 18:24:13 +02:00
Jacques Le Roux 2a7d12908b Fixed: Add TASK_STATUS to `status' field options in EditCalEvent form (OFBIZ-12271)
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
2021-07-10 12:46:21 +02:00
Nicolas Malin 076c1e254c Fixed: Link request-confirmation not generated on menus (OFBIZ-12278)
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
2021-07-09 21:12:31 +02:00
Gil Portenseigne 4e4d7144f7 Fixed: SeoConfigUtil does not maintain char-replace order (OFBIZ-12259)
Thanks: Ingo Wolfmayr for your contribution
2021-06-22 16:51:04 +02:00
Wiebke Pätzold 1f0797d5f3 Fixed: Adding tel protocol in CustomPermissivePolicy is not working
(OFBIZ-12258)

With these changes, the default sanitizers rules are only loaded if
there is no CustomPermissivePolicy
2021-06-22 12:03:27 +02:00
Jacques Le Roux 4cbc053a3f Fixed: Update PDFBox to 2.0.24 because of CVE-2021-31811 & CVE-2021-31812 (OFBIZ-12256)
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.
2021-06-13 09:14:20 +02:00
Jacques Le Roux bb254caddd Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)
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
2021-06-09 12:27:13 +02:00
Jacques Le Roux 0c5fc36b59 Fixed: XSS vulnerability for ListWorkEfforts form (OFBIZ-12254)
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
2021-06-09 11:00:39 +02:00
Jacques Le Roux bbb25daaf2 Fixed: Show WorkEffort names in FindWorkEffort page (OFBIZ-12253)
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
2021-06-06 11:52:21 +02:00
Jacques Le Roux 664fd8f39c Fixed: Failed to update work effort child (OFBIZ-12250)
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
2021-06-05 18:07:41 +02:00
Priya Sharma 40758718c9 [Fixed] Possibly currency display bug in 'Find Invoices' (OFBIZ-12177) (#302)
- 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.
2021-05-31 18:51:14 +05:30
Jacques Le Roux ad58224614 Improved: Allow to pass a Google API key for geolocation (OFBIZ-12247)
Fixes the call to the Google API key

Thanks to Daniel
2021-05-30 06:33:24 +02:00
Jacques Le Roux 81654fc155 Improved: Allow to pass a Google API key for geolocation (OFBIZ-12247)
Better way to handle a missing Google API key
2021-05-30 06:33:24 +02:00
Jacques Le Roux 7778b7692d Improved: Allow to pass a Google API key for geolocation (OFBIZ-12247)
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
2021-05-30 06:33:23 +02:00
Daniel Watford 847a400919 Fixed: Display rather than edit the From Date field of a Product Config Item Content when updating the content.
(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.
2021-05-28 10:29:14 +01:00
Daniel Watford 1e938f70ca Fixed: Typo in request parameter when editing Product Config Item
Content's content prevented retrieval of correct record.

(OFBIZ-12245)
2021-05-28 09:14:12 +01:00
wpaetzold 7badd17829 Implemented: Missing service for updateFacilityLocationGeoPoint (#296)
(OFBIZ-12242)

Thanks: Wiebke
2021-05-19 10:04:28 +02:00
Jacques Le Roux b8f9c029ce Fixed: Plugin not showing in menu due to permission (OFBIZ-12233)
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
2021-05-17 12:00:37 +02:00
Aditya Sharma b71208c4bb Reverted: unwanted changes (OFBIZ-10113) 2021-05-12 13:13:18 +05:30
Aditya Sharma 38b97e6ad3 Fixed: removed unused asmselect files and unused variable asm_asmListItemPercentOfForm (OFBIZ-10113)
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
2021-05-12 12:20:23 +05:30
Jacques Le Roux 9aa4e6c662 Fixed: Error page shown when clicking on a product Id in the purchase order page (OFBIZ-12229)
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
2021-05-01 19:10:01 +02:00
Jacques Le Roux 4d39ab2f1f Fixed: Order processing issue for dropship only products (OFBIZ-12068)
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
2021-04-27 18:55:31 +02:00
Jacques Le Roux 9730842eac Fixed: Secure the uploads (OFBIZ-12080)
Reopened after report of a bug (only on *nix systems) by Shrilesh Korgaonkar.
This fixes the issue

Thanks: Shrilesh Korgaonkar
2021-04-16 09:24:27 +02:00
Jacques Le Roux aecefda2c6 Improved: Replace Bintray by a new place to upload the Gradle Wrapper (OFBIZ-12192)
The checksum part was missing in Windows init-gradle-wrapper.ps1 script
2021-04-11 10:19:21 +02:00
Jacques Le Roux a477b32439 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
Accidentally removed PartyServices::createRoleType
2021-04-08 13:54:55 +02:00