? ? Pending

User tests: Successful: Unsuccessful:

avatar n3t
n3t
15 Apr 2021

Files and folders starting with dot didn't pass the regexpr test. So for example \var\www.tmp path didn't pass the test, which causes error during Joomla update.

Summary of Changes

Modified Reg Expressions to include files and / or folders starting with dot. The check was brought by this PR #32076 which adds InputFilter to temp path settings, however ignoring folders with dot at the beginning.

Testing Instructions

Go to Joomla settings and change your Temp path to some folder with dot at the beginning, for example \path_to_joomla.tmp (and create that folder of course). Go to Joomla update, and try to install the update.

Actual result BEFORE applying this Pull Request

Error is displayed, update is not installed.

Expected result AFTER applying this Pull Request

No errror, update is installed.

Documentation Changes Required

None

avatar n3t n3t - open - 15 Apr 2021
avatar n3t n3t - change - 15 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2021
Category External Library Libraries Composer Change
avatar brianteeman
brianteeman - comment - 15 Apr 2021

Files and folders starting with dot didn't pass the regexpr test.

thats good as they are not supposed to

avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

Paging @joomla/security as this was a security fix that is involved here @zero-24 #32076

This should not be merged until reviewed by the JSST.

avatar n3t
n3t - comment - 15 Apr 2021

@brianteeman There is no reason that those files and folders should be ommited. Especially folders. For example ".tmp" makes that folder hidden on Linux, not visible for example through FTP access.

avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

not visible for example through FTP access.

LMAO!!! Yes. They. Are. :-)

Screenshot 2021-04-15 at 22 01 35

avatar n3t
n3t - comment - 15 Apr 2021

@PhilETaylor I know you can switch on to show it, but if you just want to keep your view clean, you can easily hide it with dot.

avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

Also this repo is not the place for changes to libraries/vendor/joomla/filter/src/InputFilter.php

Those should be made in the framework repo at https://github.com/joomla-framework/input

This PR should be closed, and if you really want to propose it, and have it commented on by the @joomla/security team, then https://github.com/joomla-framework/input is the correct place.

avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

or maybe you meant to update this file? libraries/src/Filter/InputFilter.php

avatar n3t
n3t - comment - 15 Apr 2021

libraries/src/Filter/InputFilter.php only calll parent::clean function. To modify it would mean to copy all the code from libraries/vendor/joomla/filter/src/InputFilter.php...

How to get comment from @joomla/security team? Here, or need to be contacted other way?

avatar n3t
n3t - comment - 15 Apr 2021

Ok, thanks. The PR should be propably made to https://github.com/joomla-framework/filter package, or as you proposed, to 'libraries/src/Filter/InputFilter.php', or maybe directly to Model of Joomla Update component. I contacted security team to review this and give advice.

Generally this is related to issue you mentioned here #32567 but on other place of Joomla.

avatar richard67
richard67 - comment - 16 Apr 2021

@n3t Your pull request is wrong for following reasons:

  1. Your regular expressions are wrong. They will, in opposite to those in current Joomla 3 code, allow paths like e.g. /some/folder/../../../evil.php on Linux, which means breaking out of the Joomla root. This open a security hole and so cannot be accepted. You can easily very that with one of the many available sites for online execution of preg_match. Just Google for it.
  2. Any change has to be made in the https://github.com/joomla-framework/filter repository .

I suggest you open an issue with a feature request in the https://github.com/joomla-framework/filter repository. The feature request should clearly describe your requirement (to be able to use folder and file names starting with a dot).

And please don't contact anymore the SST for discussing this PR via their email for reporting security issues. The form which you have used is ONLY for reporting security issues. @PhilETaylor had already notified the right person in his comment here #33151 (comment) .

avatar richard67 richard67 - change - 16 Apr 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-04-16 08:34:50
Closed_By richard67
Labels Added: ? ?
avatar richard67 richard67 - close - 16 Apr 2021
avatar n3t
n3t - comment - 16 Apr 2021

@richard67 Thanks for your review, sorry for using contact form, I did it just because asked to. I will raise an issue on framework. Anyway, checking double dots in tmp folder set in configuration.php doesn't bring any real security in Joomla update process, as I can easily go to configuration, and set directly /other/folder/evil.php, which will pass the test as correct path...

avatar richard67
richard67 - comment - 16 Apr 2021

@n3t We don't protect a super user from himself (or herself). If you enter such an absolute path in backend you should know what you are doing. There are other ways to manipulate paths than changing in backend.

Add a Comment

Login with GitHub to post a comment