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
This commit is contained in:
Jacques Le Roux
2021-09-03 13:48:55 +02:00
parent 3e5d0b73a8
commit dfd71bf7dd
2 changed files with 47 additions and 14 deletions
@@ -151,7 +151,7 @@ SameSiteCookieAttribute=
templateClassResolver=
#-- UPLOAD: supported file formats are *safe* PNG, GIF, TIFF, JPEG, PDF, Audio and Video and ZIP
#-- ===== UPLOAD: supported file formats are *safe* PNG, GIF, TIFF, JPEG, PDF, Audio and Video and ZIP
#--
#-- No proprietary file formats (Excel, Word, etc.) are handled OOTB.
#-- They can be handled by custom projects using https://github.com/righettod/document-upload-protection:
@@ -174,6 +174,10 @@ templateClassResolver=
#-- For text files, the philosophy is we can't presume of all possible text contents used for attacks with payloads
#-- At least there is an easy way to prevent them in SecuredUpload::isValidTextFile
#--
#-- List of denied files suffixes to be uploaded
#-- OFBiz of course also check contents...
deniedFileExtensions=html,htm,php,php2,hph3,php4,php5,asp,aspx,ascx,jsp,jspx,cfm,cfc,bat,exe,com,dll,vbs,js,reg,cgi,htaccess,asis,sh,phtm,shtm,inc,asp,cdx,asa,cer,py,pl,shtml,hta,ps1
#--
#-- The upload vulnerability is only a post-auth (needs a credential with suitable permissions),
#-- people may like to allow more than what is allowed OOTB
#-- As it name says, allowAllUploads opens all possibilities