SugarCRM <= 14.0.0 (css/preview) LESS Code Injection Vulnerability
The /css/preview REST API endpoint parses unsanitised GET parameters as LESS code, allowing remote unauthenticated attackers to inject arbitrary LESS directives. By abusing the @import statement, an attacker could trigger SSRF or read local files on the web server, potentially disclosing sensitive information.
karmainsecurity.com
Published on karmainsecurity.com
User input passed through GET parameters to the /css/preview REST API endpoint is not properly sanitized before parsing it as LESS code. This can be exploited by remote, unauthenticated attackers to inject and execute arbitrary LESS directives.
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 endpoint passes unsanitised GET parameters directly to a LESS compiler, which supports file and URL imports.
Impact
An unauthenticated attacker could trigger SSRF or read arbitrary local files, potentially leading to disclosure of sensitive information.
What the attacker needed
No authentication required; network access to the 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.
LESS is a stylesheet language that gets compiled into CSS, and its @import feature can pull in other files or URLs. Because the application feeds user-supplied input straight into the LESS compiler without cleaning it, an attacker can make the server fetch remote resources or read local files. This is dangerous because the server may expose internal services or sensitive files.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.