Commit Graph
10617 Commits
Author SHA1 Message Date
Pierre Smits 1bbd2c2e2f Improved: Dutch UiLabels (OFBIZ-10363) (#402) 2021-12-09 18:36:05 +01:00
Jacques Le Roux 5a64c3d27d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In exclude.xml:
removes Confidence lines, no need to complicate things
Adds 2 DC_DOUBLECHECK false reports; synchronized is used there (maybe not the
best way but it's OK as is)

In ProductConfigWrapper::equals fixes use of == instead of equals (tested)
In UspsServices::uspsPriorityMailInternationalLabel fixes 2 possible null
dereferencements

In EntityExpr::checkRhsType fixes a possible null dereferencement
2021-12-09 07:25:25 +01:00
Jacques Le Roux ed0eb9c907 Improved: uses diamond syntax in JsLanguageFilesMapping class
No functional change
2021-12-08 16:35:33 +01:00
Jacques Le Roux d6c18f2998 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
ModelFormField::isAllChecked can't return null, must be a boolean
2021-12-06 09:44:48 +01:00
Jacques Le Roux b02255ae5f Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
No functional change: removes unused MODULE in ReferenceCleaner class
2021-12-06 09:43:52 +01:00
Jacques Le Roux ca03e21ae8 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Rearranges order of modifiers after transient insertion, in classes
ProductConfigWrapper, ModelEntity, ModelViewEntity and ModelService
2021-12-06 09:42:47 +01:00
Jacques Le Roux 1ecf6d3929 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Adds @SuppressWarnings("serial") to AbstractJob and removes unused MODULE var
from PurgeJob
2021-12-06 09:37:36 +01:00
Jacques Le Roux d4306b9f59 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
ComparableRange is a super class of DateRange that is Serializable. So
ComparableRange needs to be Serializable Too. Same with AbstractJob for PurgeJob
and GenericServiceJob
2021-12-06 09:33:31 +01:00
Jacques Le Roux ed6241cb52 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
transient is needed for not serialisable fields of a Serializable class
2021-12-06 09:23:55 +01:00
Jacques Le Roux aab412b948 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Renames ControlServlet class to OfbizControlServlet, because it shadowed the
simple name of it superclass
It can be exceptionally confusing, create lots of situations in which you have
to look at import statements to resolve references and creates many
opportunities to accidentally define methods that do not override methods
in their superclasses.

Same for XmlRpcClient.java
2021-12-05 13:03:50 +01:00
Jacques Le Roux 36b82f2b16 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
GenericEntity::getBoolean can't return null, so false

CommunicationEventServices::sendEmailToContactList handles correctly
tmpResult != null
2021-12-03 12:37:46 +01:00
Jacques Le Roux 164d39a7fc Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Removes wrong comment, it's a test class
2021-12-03 12:25:25 +01:00
Jacques Le Roux a7183cba55 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Add a comment about test methods not used OOTB
2021-12-03 09:34:33 +01:00
Jacques Le Roux 513689da96 Documented: MacroFormRenderer refactoring (OFBIZ-11456)
Adds a FIXME about: SpotBugs reporting:
Argument 1 is definitely null but must not be null
2021-11-30 19:12:33 +01:00
Jacques Le Roux 699c30ed85 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings

For FormRenderer.java it was accidentally removed for OFBIZ-12422
2021-11-30 19:03:24 +01:00
Jacques Le Roux 6274fbedbe Improved: Adds the Attributs French label 2021-11-30 12:24:15 +01:00
Jacques Le Roux 23177b182d Improved: Search/find in web tools - entity-engine generates an error (OFBIZ-12422)
I blindly followed SpotBugs advice, using a "try with resource" because the
EntityListIterator was not closed. Forgetting that it's done by purpose.

Thanks: Thanks Pierre Smits for report
2021-11-30 10:38:38 +01:00
Jacques Le Roux a3a53b5b72 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings in PackingSession.java and FormRenderer.java

Also a try with resource for FormRenderer because the EntityListIterator was not
closed.

Also removes not used setShipmentBoxTypeId method and shipmentBoxTypeId var in
PackingSession.java
2021-11-29 14:20:07 +01:00
Jacques Le Roux cfb5de4246 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings
2021-11-29 14:00:09 +01:00
Jacques Le Roux 4ac3da1082 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
If userLogin is null none of the blocks below makes sense
2021-11-29 09:56:00 +01:00
Jacques Le Roux 997cf16ed3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Useless self assignment
2021-11-19 17:51:30 +01:00
Jacques Le Roux 7ac626b23d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Repeated conditional test
2021-11-19 17:46:25 +01:00
Jacques Le Roux 59dd946078 Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a Spotbugs worry and simplifies code
2021-11-18 17:09:08 +01:00
Jacques Le Roux 5dfdb5095f Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a Spotbugs worry and clarifies code
2021-11-18 17:09:08 +01:00
Jacques Le Roux 4d9d191dfd Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Need to check for null before return
2021-11-18 08:07:53 +01:00
Jacques Le Roux 103dd6afee Improved: no functional change
Removes useless (not used) local var
2021-11-17 16:28:24 +01:00
Jacques Le Roux 185569c8aa Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Incorrect lazy initialisation

Thanks: Spotbugs
2021-11-17 16:26:11 +01:00
Jacques Le Roux dc8d6d504a Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ternary operator post increment does not work, pre increment does

Thanks: Spotbugs
2021-11-17 15:49:18 +01:00
Jacques Le Roux f126bae89c Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Char arrays can't use toString()

Thanks: Spotbugs :)
2021-11-16 16:02:51 +01:00
Pierre Smits 24fb8a99e7 Improved: entity element descriptions (OFBIZ-12383) (#343)
added:
entitymodel.xsd: desriptions for
1. table-name
2. default-resource-name
3. dependent-on
2021-11-16 12:11:58 +01:00
Pierre Smits d3ace542f0 Improved: Dutch labels for DateTime (OFBIZ-12379) (#339)
added:
Dutch tranlations for various labels in DateTimeLabels.xml
2021-11-12 18:15:34 +01:00
Jacques Le Roux 49362441b7 Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
After checking that we don't have any possible vulnerability using
jquery-ui-dist (ie 1.12.1) vs jquery-ui (1.13.0) based on* and checking in code
I decided to use jquery-ui-dist from npm. I just had to modify OfbizUtil.js to
get back to element.form() (for 1.12.1) vs element._form() for 1.13.0

I hope the npm jquery-ui-dist package will be updated soon. The release of
1.13.0 is quite fresh (<1 month).

We also need a mechanism to check the update or our npm packages.
As Aditya explained:
<<Minor updates can be handled implicitly by node when specified with tilde
range or caret range for version. For major updates, we just have to change
the version and use npm install.>>
So for now it will be manual. Later something like** could be used (I wonder
about https://snyk.io/, but that needs Infra agreement)

* https://blog.jqueryui.com/2021/10/jquery-ui-1-13-0-released/
** https://dev.to/dennismphil/automate-your-node-dependency-updates-4aga
2021-11-11 16:05:35 +01:00
wpaetzold 3d93c2709e Fixed: Builds fail due to unauthorized access to repo.spring.io/plugins-release (OFBIZ-12351) (#334)
Replaces repository syndication by rometools

Thanks Mart Naum for report
2021-11-09 14:34:44 +01:00
Jacques Le Roux d83603f064 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (INFRA-22279)
At Gavin's request a non functional change to test Buildbot migration
2021-11-06 12:48:40 +01:00
Jacques Le Roux ce564ebc2a Improved: Try to reduce "Incomplete string escaping or encoding branch" issues reported by CodeQL (OFBIZ-12356)
GH CodeQL reports 556 "Incomplete string escaping or encoding branch" issues
(there are 588 issues at all).

Most of them are in jQuery-UI but not only. So this only an attempt to clarify
among the 23 pages reported by upgrading jQuery-UI to 1.13.0.
2021-10-31 15:29:30 +01:00
Jacques Le Roux 9f822ab337 Improved: removes Java compilation unchecked] and deprecation warnings 2021-10-18 13:33:52 +02:00
Jacques Le Roux 2489381f7f Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Adds unused hashCode method to *ArtifactInfo and PackingSession classes
Makes final CmsEvents, ContactMechWorker and PartyWorker classes

There are no longer any checkstyle issues
2021-10-17 15:59:35 +02:00
Jacques Le Roux 49cae3c73a Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Adds getter and setter to ScreenRenderer class
Adds unused hashCode method to ControllerRequestArtifactInfo class
Makes final UomWorker and ContactHelper classes

Only 10 checkstyle issues now
2021-10-17 15:45:55 +02:00
Jacques Le Roux c85f60279b Improved: Remove Checkstyle warning related to double parenthesis at start of lines (OFBIZ-12340)
At https://markmail.org/message/3mhzlqew3igad3r2 I reported an issue that I was
not able to really qualify. After exchanging with a Checkstyle expert
(see markmail thread).

I was unable to find what in our checkstyle.xml file was wrongly throwing these
warnings. I decided that there was no reason to throw those warnings.

So I decided to put the SuppressionCommentFilter in our checkstyle.xml file and
use CHECKSTYLE_OFF: ALMOST_ALL/CHECKSTYLE_ON: ALMOST_ALL around
the concerned lines as documented here
https://checkstyle.sourceforge.io/config_filters.html#SuppressionCommentFilter_Examples
2021-10-17 15:38:30 +02:00
Jacques Le Roux 87f9981f71 Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Fixes wrong methods names in EntityFunction class
2021-10-17 10:49:51 +02:00
Aditya Sharma 4bd30ce4d5 Implemented: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
Removed javascript for jQuery, jQuery Migrate, jQuery Browser and jQuery Validation from OFBiz sources. Instead these are now retrieved during the build as NPM packages using gradle-node-plugin.

Thanks: Aditya Sharma for implementation.
2021-10-12 20:50:41 +01:00
Jacques Le Roux 3cb4e791e0 Improved: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Prevents an useless inevitable warning by commenting out
RequestWrapper::getParameterNames and with it all the unused methods in
RequestWrapper class

Also better comments CacheFilter::doFilter by giving its real and only goal:
<<to prevent a post-auth security issue described in OFBIZ-12332>>
2021-10-11 09:45:09 +02:00
Jacques Le Roux 351d752690 Improved: Refactor methods signature to reduce the number of params they use (OFBIZ-12335)
Fixes a typo about filterConfiguration in CacheFilter.java
2021-10-10 13:32:49 +02:00
Jacques Le Roux 19d2932591 Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
In previous commit, in CacheFilter::doFilter, I checked "xmlrpc"  when it was
actually "/control/xmlrpc"
2021-10-10 11:24:55 +02:00
Jacques Le Roux a5bdcc6f9e Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
This definitely solves all issues by introducing a CacheFilter and
RequestWrapper classes inspired by several works found on the Net.
Also moves the change introduced before in ContextFilter to CacheFilter.

The basic problem is that you only can use once
ServletRequest::getInputStream or the ServletRequest::getReader
Also not both, even once, ie they can be seen as same from this POV.

The integration tests all pass.

Also replace the checked String "</serializable>" by "</serializable" as, like
reported by Jie Zhu, the former could be bypassed by using "</serializable >"

Thanks: Jie Zhu for report
2021-10-10 08:00:51 +02:00
Jacques Le Roux cd03a6a98f Improved: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
Temporarily comments out XMLRPC tests.

I'll work on a definitive solution ASAP
2021-10-09 07:48:55 +02:00
Jacques Le Roux 9c1698917a Fixed: post-auth Remote Code Execution Vulnerability (OFBIZ-12332)
As reported by Jie Zhu:
<<The latest version of the OFBiz framework (17.12.08) is affected by an
XMLRPC Remote Code Execution Vulnerability.
This vulnerability is caused by incomplete patch repair of cve-2020-9496.>>

Actually this is not an OFBiz bug (so not related to CVE-2020-9496)
but an old XMLRPC bug (Archiva was(/is?)) also affected:
https://nvd.nist.gov/vuln/detail/CVE-2016-5003

Unfortunately XMLRPC is no longer maintained, so it's OFBiz responsibility to
fix this bug.

As the code that secures serialisation in OFBiz is not reached by this bug, the
solution is to secure it at the ContextFilter class level (ie before it reaches
secured serialisation in OFBiz source).

Thanks: Jie Zhu for report and help.
2021-10-08 19:13:20 +02:00
Daniel Watford dabafa77f9 Improved: Use FTL with_args on macro calls (OFBIZ-12274)
Previous approach to rendering FTL macros was to encode all macro
arguments as a single string and pass to the FTL processor.

New approach is to use FTL's default wrapper to handle passing Java
types to the FTL processor and referencing them from macro calls.

Thanks: Xin Wang for introducing FTL with_args approach and providing
POC.
2021-09-27 10:33:17 +01:00
Jacques Le Roux dfc05edbab Improved: Remove Docbook parts now useless since Ascidoc is used for online help (OFBIZ-12327)
At https://markmail.org/message/inoihmcon37wq5zz I suggested:

If I'm not wrong, we no longer use Docbook anywhere. So I suggest to remove it
from:

1. cmssite component, where it was used by the online help, now assured by
    Asciidoc. BTW, for whom it could concern, I noticed that anchors jumping
    in adoc files does not work in online help
2. docbook.dtd in content component only used by the cmssite component
3. docbook.css in themes, I'm not sure that still useful there
2021-09-25 10:31:03 +02:00
Gil Portenseigne 3cea95fc4c Create a deny list to reject webshell tokens (OFBIZ-12324)
Replace java 9 `List.of` that is not yet compatible with current CI java
configuration (java 8)
2021-09-23 15:30:42 +02:00