User tests: Successful: Unsuccessful:
The template manager reads the file to act on from the base64 file request parameter and builds an absolute path from it. save(), deleteFile(), renameFile() and copyFile() pass that path to File::write / File::delete / rename / File::copy after only Path::clean(), which normalizes separators but leaves .. intact. The read path getSource() already runs the same value through Path::check(); these mutating methods now do the same, so a file value that decodes to a ../ sequence is rejected instead of resolving outside the template directory.
Log in to the backend as a user with template edit rights and open a template in Templates: Customise. Capture the template.save (or the deleteFile / renameFile / copyFile task) request and set the file parameter to Li4vLi4vLi4vLi4vdG1wL3gucGhw (base64 of ../../../../tmp/x.php), which passes the cmd input filter unchanged.
The request writes, deletes, renames or copies a file outside the active template directory.
The operation is refused and the target stays contained to the template directory, matching how getSource() already validates the read path.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_templates |
From what I know, the file handling functions of the template manager are hard limited to superusers only, and that cannot be changed by any ACL.
Correct and as a superuser you could do whatever you wanted anyway so even with this restriction in place it won't stop a super user being able to move wherever they want to in the filesystem. All you can doo is to hack yourself
You're right on both counts. I tested with a super user, not a lower-privileged account, and since these template file tools are super-user-only that's the only role that ever reaches this code. A super user already has full filesystem access by other means, so I agree this isn't a real privilege boundary, my testing note was misleading on that.
And yes, it overlaps #47851, which makes the same Path::check() fix and also covers cropImage/resizeImage. No point keeping two, so I'll close this in favour of that one. Thanks both.
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-07-01 14:25:05 |
| Closed_By | ⇒ | arib06 | |
| Labels |
Added:
Information Required
PR-5.4-dev
|
||
From what I know, the file handling functions of the template manager are hard limited to superusers only, and that cannot be changed by any ACL.
@arib06 Please report back which kind of user you have used for your issue, superuser or not.