SugarCRM <= 13.0.1 (set_note_attachment) Unrestricted File Upload Vulnerability
The set_note_attachment SOAP call lets an authenticated user upload any file type into the upload directory. Because a nested .htaccess file can override the parent protection, an attacker could upload a file that makes PHP executable and then run code on the server.
karmainsecurity.com
Published on karmainsecurity.com
When handling the setnoteattachment SOAP call, the application allows uploading of any kind of file into /upload/ directory. This one is protected by the main SugarCRM .htaccess file, i.e. it doesn’t allow access/execution of PHP files.
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 upload handler does not restrict file extensions or content, and the upload directory's protection can be overridden by a nested .htaccess file the attacker supplies.
Impact
An authenticated attacker could upload a nested .htaccess file to disable the PHP execution block and then run arbitrary code on the server.
What the attacker needed
Authenticated SugarCRM user; ability to call the SOAP endpoint
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.
The application lets a logged-in user attach any kind of file to a note, including files that the server can run as programs. Normally a configuration file blocks those programs from running, but the attacker can upload their own configuration file to switch that protection off. That would let them run their own code on the server.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.