? ? J4 Media Manager Pending

User tests: Successful: Unsuccessful:

avatar SniperSister
SniperSister
31 Jul 2021

Summary of Changes

Added a check in the rename action of com_media to make sure that the new extension does not violate the list of allowed extensions.

Testing Instructions

  1. Open browser dev tools
  2. Open the rename dialog in com_media and hit save without changing the name
  3. Inspect that last request in the network tab of the dev tools, edit it and change the file extension of the new_path parameter in the request body to a disallowed value, i.e. php
  4. Verify that the file was renamed
  5. Apply patch
  6. Redo 1-3
  7. Verify that the file could not be renamed anymore

Actual result BEFORE applying this Pull Request

No check of extension

Expected result AFTER applying this Pull Request

Check of extension

avatar SniperSister SniperSister - open - 31 Jul 2021
avatar SniperSister SniperSister - change - 31 Jul 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jul 2021
Category Unit Tests Repository Administration
avatar SniperSister SniperSister - change - 31 Jul 2021
Labels Added: J4 Media Manager ?
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jul 2021
Category Unit Tests Repository Administration Libraries Front End Plugins
avatar brianteeman
brianteeman - comment - 31 Jul 2021

Why is it not using the list of filters here #35001

Why are the two lists different eg php5, php6 etc

Surely there should be just one list

avatar SniperSister SniperSister - change - 31 Jul 2021
Labels Added: ?
avatar SniperSister
SniperSister - comment - 31 Jul 2021

I have added the extensions for php3-8, good catch! @brianteeman @richard67

avatar richard67 richard67 - test_item - 31 Jul 2021 - Tested successfully
avatar richard67
richard67 - comment - 31 Jul 2021

I have tested this item successfully on 16cf307

Tested as described in testing instructions.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34999.

avatar brianteeman
brianteeman - comment - 31 Jul 2021

not sure where your list comes from but I would add
.MSI – A Microsoft installer file.
.JAR – .JAR files contain executable Java code. If you have the Java runtime installed, .JAR files will be run as programs.

but there are a lot more https://www.lifewire.com/list-of-executable-file-extensions-2626061

avatar HLeithner
HLeithner - comment - 31 Jul 2021

not sure where your list comes from but I would add
.MSI – A Microsoft installer file.
.JAR – .JAR files contain executable Java code. If you have the Java runtime installed, .JAR files will be run as programs.

but there are a lot more https://www.lifewire.com/list-of-executable-file-extensions-2626061

Don't know ether but msi (not sure about jar) will not be execute by a webserver.

avatar brianteeman
brianteeman - comment - 31 Jul 2021

Don't know ether but msi (not sure about jar) will not be execute by a webserver.

Neither would many of the others (unless it is a windows webserver)

avatar SniperSister
SniperSister - comment - 2 Aug 2021

@brianteeman @HLeithner added MSI and JAR

avatar brianteeman
brianteeman - comment - 2 Aug 2021

I still dont understand why this list is different to the list in the other PR or why this list is even used when the other list could be.

One list, less mistakes.

avatar wilsonge
wilsonge - comment - 2 Aug 2021

@SniperSister maybe we should create the static list of executables in the framework input filter package and then they can be maintained as a single list that way as @brianteeman says rather than having our duplicate here in the MediaHelper class?

avatar brianteeman
brianteeman - comment - 2 Aug 2021

@wilsonge thats what I keep saying but get ignored #35001 is a partially identical list (and should be identical)

avatar SniperSister
SniperSister - comment - 2 Aug 2021

@wilsonge it's not a duplicate, it's only partially identical with the list in the InputFilter focussing on file types that might be executable directly within the web server, resulting in code executions. The list in the mediahelper also includes file types that are able to execute code not only in the webserver but also in a general OS scenario or even in the browser

avatar brianteeman
brianteeman - comment - 2 Aug 2021

still better to have just one to avoid mistakes or just have the list in mediahelper extend the inputfilter

/me doesnt see/agree with your supposed differences - especially for windows servers

avatar SniperSister
SniperSister - comment - 2 Aug 2021

or just have the list in mediahelper extend the inputfilter

That's fine for me

@wilsonge your call. Let me know how you want it solved.

avatar wilsonge
wilsonge - comment - 4 Aug 2021

or just have the list in mediahelper extend the inputfilter

This makes sense to me too. Let's go with it!

avatar wilsonge
wilsonge - comment - 4 Aug 2021

Whilst your at it can you just expand the comment on the class property to mention your explanation so it's super clear for people in the future. Thankyou :)

avatar wilsonge
wilsonge - comment - 7 Aug 2021

@SniperSister please can you look at this. It needs to be ready by tuesday for the final RC or it's not going in :)

avatar SniperSister SniperSister - change - 8 Aug 2021
Labels Added: ? ?
Removed: ? ?
avatar SniperSister
SniperSister - comment - 8 Aug 2021

@wilsonge done!

avatar richard67 richard67 - test_item - 8 Aug 2021 - Tested successfully
avatar richard67
richard67 - comment - 8 Aug 2021

I have tested this item successfully on 4b6b32e

Checked with values from both arrays (input filter and media helper) that the manipulated request results in a 500 response and the file is not renamed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34999.

avatar wilsonge wilsonge - close - 8 Aug 2021
avatar wilsonge wilsonge - merge - 8 Aug 2021
avatar wilsonge wilsonge - change - 8 Aug 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-08 17:36:08
Closed_By wilsonge
Labels Added: ? ?
Removed: ? ?

Add a Comment

Login with GitHub to post a comment