Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputFilter - ZIP file with no forbidden file extensions in contents triggers file extension filter #30606

Closed
rozniak opened this issue Sep 9, 2020 · 1 comment

Comments

@rozniak
Copy link

rozniak commented Sep 9, 2020

Steps to reproduce the issue

Upload the ZIP file referenced in the additional comments section below.

Expected result

The ZIP is successfully uploaded.

Actual result

The ZIP fails to upload, it is filtered by InputFilter::isSafeFile.

System information (as much as possible)

Debian 9 x64
PHP 7.2.33
Joomla! 3.9.21

Additional comments

I have traced the error down to this specific check in InputFilter::isSafeFile:
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Filter/InputFilter.php#L720

Here is a link to the affected ZIP file (managed to upload by commenting out the return false; statement in the above check): https://www.limingtonhouseschool.co.uk/files/SDT%20Teacher%20Application%20Pack.zip

The ZIP file in question is very mundane - it is just a simple job application pack containing PDF and DOCX files. It is attached. It triggers the check for the .py extension - if you grep this ZIP file it will match this command:

grep "\.py" SDT\ Teacher\ Application\ Pack.zip

I am not sure why this filter checks for instances of a string file extension on binary files, this file just by coincidence results in a match when searching for ".py", despite it not containing any files of that extension.

@Quy
Copy link
Contributor

Quy commented Sep 9, 2020

Duplicate #26408. Thanks for reporting.

@Quy Quy closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants