Fortinet FortiWeb cgi_xmlprotection_xmlschemafile_post Directory Traversal Arbitrary File Write Vulnerability
The cgi_xmlprotection_xmlschemafile_post function in FortiWeb fails to validate a user-supplied path before using it in file operations, allowing an authenticated remote attacker to create arbitrary XML schema files as root.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to create arbitrary XML schema files on affected installations of Fortinet FortiWeb. Authentication is required to exploit this vulnerability.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the function cgi_xmlprotection_xmlschemafile_post takes a user-supplied path and uses it in file operations without validating that the path stays within an intended directory.
Impact
An authenticated remote attacker could create XML schema files anywhere on the system with root privileges, potentially leading to further compromise.
What the attacker needed
Authentication required
The fix
Fortinet has issued an update to correct this vulnerability.
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 report has not been written yet. The Original tab links to the source.
FortiWeb is a web application firewall. A function that handles uploaded XML schema files did not check where the file was being written. An attacker who is already logged in could use a crafted path to write files anywhere on the system, even as the root user.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.