mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
SECURITY: Safely decompress files. (#8124)
* FEATURE: Adds an extra protection layer when decompressing files. * Rename exporter/importer to zip importer. Update old locale * Added a new composite class to decompress a file with multiple strategies * Set max file size inside a site setting * Ensure that file is deleted after compression * Sanitize path and files before compressing/decompressing
This commit is contained in:
@ -50,7 +50,7 @@ describe Admin::ThemesController do
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
# Save the output in a temp file (automatically cleaned up)
|
||||
file = Tempfile.new('archive.tar.zip')
|
||||
file = Tempfile.new('archive.zip')
|
||||
file.write(response.body)
|
||||
file.rewind
|
||||
uploaded_file = Rack::Test::UploadedFile.new(file.path, "application/zip")
|
||||
|
Reference in New Issue
Block a user