Skip to content

Commit

Permalink
Fixed issues [security] #14379, #14380, #15796: Stored XSS through SV…
Browse files Browse the repository at this point in the history
…G file upload. Thanks to Denis Chenu and Maxime Roy

SVG file uploads are now disallowed as default
  • Loading branch information
lime-marc committed Feb 11, 2020
1 parent d51f5f7 commit 68859ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .htaccess
Expand Up @@ -18,3 +18,11 @@ RedirectMatch 403 ^/(?!\.well-known/)(.*/)?\.+

# General setting to properly handle LimeSurvey paths
# AcceptPathInfo on

# XSS protection
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
<FilesMatch "\.(svgz?)$">
Header set Content-Security-Policy "default-src 'none'; frame-ancestors 'none'; style-src 'self' 'unsafe-inline'"
</FilesMatch>
</IfModule>
4 changes: 2 additions & 2 deletions application/config/config-defaults.php
Expand Up @@ -84,8 +84,8 @@
$config['defaulttheme'] = 'fruity'; // This setting specifys the default theme used for the 'public list' of surveys
$config['customassetversionnumber'] = 1; // Used to generate the path of tmp assets (see: LSYii_AssetManager::generatePath() )

$config['allowedthemeuploads'] = 'gif,ico,jpg,png,css,js,map,json,eot,svg,ttf,woff,txt,md,xml,woff2,twig'; // File types allowed to be uploaded in the themes section.

// Please be very careful if you want to allow SVG files - there are several XSS dangerous security issues
$config['allowedthemeuploads'] = 'gif,ico,jpg,png,css,js,map,json,eot,ttf,woff,txt,md,xml,woff2,twig'; // File types allowed to be uploaded in the themes section.
$config['allowedresourcesuploads'] = '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,ico,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,xml,zip,css,js'; // File types allowed to be uploaded in the resources sections, and with the HTML Editor

$config['memory_limit'] = '256'; // This sets how much memory LimeSurvey can access in megabytes. 256 MB is the minimum recommended - if you are using PDF functions up to 512 MB may be needed
Expand Down

0 comments on commit 68859ba

Please sign in to comment.