Miggo Logo

CVE-2025-32960: XSS in the /files Endpoint of the Generic REST API

6.4

CVSS Score
3.1

Basic Information

EPSS Score
0.18748%
Published
4/22/2025
Updated
4/23/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
com.haulmont.addon.restapi:restapi-rest-apimaven< 7.2.77.2.7

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description states that the /files endpoint can be manipulated to return Content-Type: text/html if the filename ends with .html, leading to XSS. The provided commit b3d599f6657d7e212fdb134a61ab5e0888669eb1 patches this vulnerability.

The commit modifies FileDownloadController.java. Specifically, the downloadFile method is altered. A new method, resolveAttachmentValue, is introduced, and downloadFile now calls it to determine if a file should be served as an attachment or inline. The resolveAttachmentValue method checks the file extension against a configurable list of allowed inline extensions (inlineEnabledFileExtensions from RestApiConfig.java, also modified in the patch).

The downloadFile method is identified as the vulnerable function because it was the one directly responsible for serving the file and, prior to the patch, its logic for setting HTTP headers (like Content-Disposition and Content-Type) allowed HTML files to be rendered inline by the browser. The patch changes this behavior within downloadFile by incorporating the stricter logic from resolveAttachmentValue.

The other modified/added functions (resolveAttachmentValue in FileDownloadController.java and getInlineEnabledFileExtensions in RestApiConfig.java) are part of the mitigation, not the vulnerable code itself. The vulnerability existed in the downloadFile method's previous behavior.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** input p*r*m*t*r, w*i** *onsists o* * *il* p*t* *n* n*m*, **n ** m*nipul*t** to r*turn t** *ont*nt-Typ* *****r wit* t*xt/*tml i* t** n*m* p*rt *n*s wit* .*tml. T*is *oul* *llow m*li*ious J*v*S*ript *o** to ** *x**ut** in t** *rows*r. *

Reasoning

T** vuln*r**ility **s*ription st*t*s t**t t** `/*il*s` *n*point **n ** m*nipul*t** to r*turn `*ont*nt-Typ*: t*xt/*tml` i* t** *il*n*m* *n*s wit* `.*tml`, l***in* to XSS. T** provi*** *ommit `****************************************` p*t***s t*is vuln