User tests: Successful: Unsuccessful:
Pull Request resolves #
This PR validates ZIP entry paths in TemplateModel::extractArchive() to prevent a Zip Slip path traversal vulnerability.
Issue: extractArchive() calls $zip->extractTo($path) without checking whether archive entries contain ../ sequences that could escape the target directory. A maliciously crafted template ZIP could overwrite files outside the template directory (e.g., ../../configuration.php).
Fix: Before extracting, iterate all entries and reject any whose real path falls outside the intended extraction root. Returns an error if any traversal attempt is detected.
../../evil.php and attempt to install it as a template — the installation should fail with an error message.A template ZIP with traversal paths (../) can extract files outside the template directory.
ZIP entries with paths outside the target directory are detected and extraction is aborted with an error.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_templates Language & Strings |
Apologies @brianteeman — PR description has been updated with the full template including summary, testing instructions, before/after results, and documentation checkboxes.
There was a reason that you were given a template to complete when you submitted this PR. Please update your pr with the required information. You can find the template here https://github.com/joomla/joomla-cms/blob/5.4-dev/.github/PULL_REQUEST_TEMPLATE.md
In addition please read https://github.com/joomla/joomla-cms/security