Skip to content
File upload Write-up Intermediate

SugarCRM <= 12.2.0 (Notes) Unrestricted File Upload Vulnerability

The Notes module's save action let a user upload files of any type into the upload directory, which is normally protected from PHP execution by the main .htaccess file. An attacker could override that protection by placing a further .htaccess file in a subdirectory, potentially allowing uploaded PHP to be executed.

karmainsecurity.com

Published on karmainsecurity.com

When handling the “save” action within the “Notes” module the application allows uploading of any kind of file into the /upload/ directory. This one is protected by the main SugarCRM .htaccess file, i.e. it doesn’t allow access/execution for PHP files.

The author, on karmainsecurity.com

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 did not restrict file types or block uploads of server configuration files such as .htaccess, so the directory-level execution block could be overridden.

Impact

An attacker could potentially upload and execute PHP code on the server, though the text only states the protection 'can be overridden' and does not demonstrate execution.

What the attacker needed

Authenticated user able to use Notes; ability to create a subdirectory

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.

A file upload feature accepted any kind of file, including scripts, rather than only safe documents. The server normally blocks those scripts from running, but a user could add their own configuration file in a subfolder to switch that block off. That could let an attacker 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.