Commit Graph
273 Commits
Author SHA1 Message Date
Jacques Le Roux c2c609d8e4 Improved: Dependency verification (OFBIZ-12186)
I just read an ASF members thread about this article:
https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610

One member mentioned that the Groovy project is using the Gradle's dependency
verification feature[1] in the Apache Groovy build.

I suggest we do the same, even after the move from JCenter to MavenCentral where
things should be safer.

[1] https://docs.gradle.org/current/userguide/dependency_verification.html

This commit includes:
The  verification-metadata.xml and verification-keyring.gpg used by the
verification task
*.gpg as binary in .gitattrubtes for verification-keyring.gpg

The documentation about the verification in sy-dependency-verification.adoc
with a link and some unrelated changes in security.adoc about security for
OFBiz in production
An empty line removed in build.gradle
2021-02-27 13:53:33 +01:00
Jacques Le Roux 67e4f61a66 Fixed: fixes wrong wiki URL 2021-02-22 11:45:43 +01:00
Jacques Le Roux 78dd625bbe Improved: Display last-visited-time popup after login (OFBIZ-12148)
Makes afterlogin.lastvisit.show to false by default and document that in the
security documentation, ie in
https://cwiki.apache.org/confluence/display/OFBIZ/How+to+secure+your+deployment

Else when working in dev mode you always have to remove or wait the message to
remove itself

Fixes wrong wiki links in sy-password-and-JWT.adoc
2021-02-22 11:15:28 +01:00
Jacques Le Roux e988dd4efd Improved: increases some French labels length
They fits with new enlarged second menu in Rainbow Stone
2021-02-21 12:31:13 +01:00
Michael Brohl 69c62f5f00 Merge changes for PR #267 due to conflicting changes in trunk (OFBIZ-12169) 2021-02-15 17:15:18 +01:00
Michael Brohl 662a3f9d1c Improved: Remove Compdoc functionality from content manager
(OFBIZ-10476)
2021-02-13 17:33:05 +01:00
Jacques Le Roux d60bf1574b Fixed: Remove _PREVIOUS_REQUEST_ Session Attribute on non-authentication pages (OFBIZ-12047)
After some small study, it seem there is a problem because login request not
require authentication

I have tried to add a test to check if current request is login and only if it's
not to remove PREVIOUS_REQUEST Session Attribute, it seem better with this
modification.

Thanks: Olivier for the patch and Michael for suggesting to parameterize using
a property. I simply used EntityUtilProperties.getPropertyValue instead of
UtilProperties.getPropertyValue
2021-02-13 12:29:02 +01:00
Michael Brohl 29bf0a040a Merge branch 'trunk' into OFBIZ-12169_Handle_remaining_checkstyle_errors 2021-02-13 11:26:01 +01:00
Jacques Le Roux 89b2dbaec9 Improved: Handle remaining checkstyle errors (OFBIZ-12169)
As I mentioned I copied and adapted the code from
document-upload-protection sanitizer. Focused on the issue at hand I did not
take care much about the style.

Finally (pun intended ;)) I prefer to use a try-with-ressource for fos.

Thanks: Wiebke for proposing another solution at
https://github.com/apache/ofbiz-framework/pull/267/commits/51e82c66989b093392a06cb800fc84a7e413fe45
2021-02-13 10:42:32 +01:00
Deepak Dixit 782bddb729 Fixed File Resource not found console warning related to already removed data files 2021-02-12 12:55:31 +05:30
Wiebke Pätzold 51e82c6698 Improved: Removes nested blocks and closed OutputStream in finally
statment (OFBIZ-12169)
2021-02-10 10:18:07 +01:00
James Yong ad0211ab2d Improved: Display last-visited-time popup after login (OFBIZ-12148) (#266)
Improved: Display last-visited-time popup after login (OFBIZ-12148)

To allow users to know of any unauthorised access to their accounts.

Thanks: Michael for review
2021-02-08 00:04:29 +08:00
Jacques Le Roux c7e1114b74 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:06:02 +01:00
Jacques Le Roux c4650ff9bc 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:00:37 +01:00
Jacques Le Roux 179dd2411a 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:46:05 +01:00
Jacques Le Roux 63e2b526b8 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:46:32 +01:00
James Yong 89f36f1a06 Correct spelling for μManager.
Reference: https://imagejdocu.tudor.lu/faq/general/which_file_formats_are_supported_by_imagej
2020-12-08 19:49:15 +08:00
James Yong 931716a628 Improve notes for Tomcat SSO 2020-12-08 19:37:21 +08:00
Jacques Le Roux 100810faeb Fixed: Secure the uploads (OFBIZ-12080)
Adds audio and video as supported formats
2020-12-07 19:48:36 +01:00
Jacques Le Roux 4481f373ca 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 18:45:24 +01:00
Jacques Le Roux e73616caf1 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.
2020-12-01 10:16:04 +01:00
holivier 7c7eae2f84 Improved: Error messages when generating HTML and PDF file from AsciiDoc files (OFBIZ-11893)
sy-impersonation.adoc minor correction,
* imagesDir cannot be out of asciidoc directory because content of it s copied in build directory when document is generated
* internal link to go to sub-section security was wrong because securty automatic anchor is generate for general security chapter
2020-10-02 18:23:14 +02:00
Akash Jain 66a76ffd5a Improved: Fix Literals comparisons with variable to avoid NPE (OFBIZ-11929)
Thanks, Devanshu Vyas for your contribution.
2020-08-30 17:20:23 +05:30
Suraj Khurana f357b997c0 Improved: Corrected class names, method names, data members of class and variables names in framework component.
(OFBIZ-11926)
Also corrected some formatting and line length related checkstyle issues.
2020-08-26 21:40:40 +05:30
Suraj Khurana 9689201b84 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements.
Thanks jacques for finalizing Javadoc pattern during this effort.
2020-08-22 13:20:39 +05:30
Suraj Khurana 8c10d4ae72 Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
This is done for framework component. Also corrected some variables as per naming convention best practices.
Thanks Jacques for review.
2020-08-17 12:30:26 +05:30
Priya SharmaandPriya Sharma 9e7df96921 Improved: Move 'SecurityPermission' data to seed data files (OFBIZ-10575) (#225)
Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-08-11 16:01:18 +02:00
Suraj Khurana 33f05c1684 Improved: Corrected all redundant modifiers occurences in framework component. Also, fixed some other checkstyle line formatting and spacing issues.
(OFBIZ-11925)
2020-08-06 18:53:13 +05:30
Suraj Khurana d374019465 Improved: Corrected all incorrect indentation level issues in framework component, also fixed some case indentation checkstyle issues.
(OFBIZ-11922)
2020-07-26 21:04:41 +05:30
Suraj Khurana 8b1e0dbd85 Improved: Corrected all checkstyle formatting issues: 'typecast' is not followed by whitespace in framework component.
(OFBIZ-11887)
2020-07-18 12:26:42 +05:30
Suraj Khurana dd4da77d76 Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for framework component.
(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.
'{' is not followed by whitespace.
'}' is not followed by whitespace.
'}' is not preceded with whitespace.
'typecast' is not followed by whitespace.
'try' is not followed by whitespace.
';' is preceded with whitespace.
2020-07-11 14:33:47 +05:30
Jacques Le Roux d0fceffadd Fixed: don't remove localhost from host-headers-allowed it was only for testing 2020-07-11 09:59:17 +02:00
Jacques Le Roux 3c9fe5f916 Improved: better message for host-headers-allowed
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.
2020-07-11 09:59:16 +02:00
Suraj Khurana 443025e37f Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 2020-07-07 15:10:53 +05:30
Suraj Khurana fc6b8a6ca3 Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
2020-07-07 15:08:17 +05:30
Jacques Le Roux 16c2d35219 Documented: CsrfDefenseStrategy in case of no support for SameSite cookie attribute
Use of CsrfDefenseStrategy in case of potential use of a browser version not
supporting the SameSite cookie attribute

Refer to https://caniuse.com/#feat=same-site-cookie-attribute
2020-07-06 15:15:48 +02:00
Pawan Verma e19b12eae9 Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is already done in the declared type.
2020-06-28 01:04:51 +05:30
holivier 192059e3da Improvement: Help link using asciidoc files via generated html
(OFBIZ-11693)

Change release for all asciidoc files, now there area 3 publish site,
one per release
* site/trunk
* site/next   currently for the 18.12
* site/stable currently for the 17.12
2020-06-04 17:56:54 +02:00
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux 10b8acd5d1 Improved: removes useless "@deprecated No replacement" comments in Java code
This follows a discussion on dev ML 5 days ago.
Those comments are useless because they are all related to Minilang and Minilang
is deprecated as a whole.
2020-05-27 09:26:56 +02:00
Jacques Le Roux a6e8b05135 Improved: Prevent FreeMarker Template Injection (SSTI)
(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
2020-05-18 12:06:28 +02:00
Jacques Le Roux e8e9db5b1a Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes check style. I removed a space after a cast. That's how I wrote it so
far and that was wrong. BTW I did not invent it, our code is riddled of it:/

https://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141388.html
2020-04-27 14:29:14 +02:00
Jacques Le Roux faf2827e67 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes the if(test): toString() is not the same than getCanonicalName()

Also while at it, in case of exception, uses NoCsrfDefenseStrategy as default
2020-04-27 12:36:17 +02:00
Jacques Le Roux cdb40c3d31 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-11609)

Fixes check style issues
2020-04-26 14:21:59 +02:00
Jacques Le Roux 1ff79ec566 Improved: Prevent recurring errors block due to generateTokenForNonAjax
(OFBIZ-)

After the VM demos crash yesterday, I had a look at the log of trunk demo and
found a lot of recurring errors block due to CsrfUtil::generateTokenForNonAjax.

It's not a big deal but it's annoying to have such useless errors cluttering the
logs
2020-04-26 12:38:05 +02:00
Jacques Le Roux a721ba7557 Documented: fixes wrong indentations 2020-04-20 18:57:58 +02:00
Jacques Le Roux 07a472f89c Documented: improves security.properties documentation 2020-04-15 19:31:51 +02:00
Jacques Le Roux fdb995fd50 Documented: adds CSRF defense and updates password and JWT 2020-04-15 19:30:53 +02:00
Jacques Le Roux d8025d41dc Improved: Add security.internal.sso.enabled and security.token.key
SystemProperties

(OFBIZ-11594)(OFBIZ-11470)

After adding more latitude to set same site by using
EntityUtilProperties::getPropertyValueFromDelegatorName for retrieving the value
possibly from the DB as a SystemProperty, adds the value as strict in
SSOJWTDemoData.xml
2020-04-15 15:15:13 +02:00
Jacques Le Roux ff9335ac8c Improved: Add security.internal.sso.enabled and security.token.key
SystemProperties

(OFBIZ-11594)

This comes handy when testing, from examples component, the internal SSO feature
which allows a token based login between OFBiz instances

The SSOJWTDemoData.xml inadvertently slipped in w/ previous commit
2020-04-13 12:14:48 +02:00