XenForo <= 2.2.13 (ArchiveImport.php) Zip Slip Vulnerability
The ArchiveImport::extractFilesToTempDir() method in XenForo 2.2.13 and earlier does not properly validate zip entry names, allowing a crafted archive to write files outside the intended temporary directory. An attacker could use this to overwrite or create arbitrary files on the server.
karmainsecurity.com
Published on karmainsecurity.com
The vulnerability is located in the /src/XF/Service/Style/ArchiveImport.php script.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code builds the final file path by concatenating the temporary directory with the zip entry name without checking for path traversal sequences such as '../'.
What the attacker needed
Ability to upload a style archive
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When a website lets you upload a zip file and then unpacks it, it should only write the files into a safe folder. This code fails to check the names inside the zip, so a malicious zip can contain a file path that escapes the folder and writes elsewhere on the server. That is called a Zip Slip vulnerability.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.