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
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
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
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
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...
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/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.
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
(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.
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-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
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.
(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
(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
(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
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
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