The vulnerability is an unrestricted file upload in erupt <= 1.12.19 at the endpoint /upload/GoodsCategory/image.
-
I first tried to find a specific patch by comparing version 1.12.19 (last known vulnerable) with 1.12.20. However, the commits between these versions did not show a clear security fix related to file uploads. Most changes were related to AI features or general UI/refactoring.
-
Given the endpoint structure, I looked for controllers that handle file uploads. The EruptFileController.java was identified.
-
Within EruptFileController.java, the method upload(@PathVariable("erupt") String eruptName, @PathVariable("field") String fieldName, @RequestParam("file") MultipartFile file) is mapped to the path @PostMapping("/upload/{erupt}/{field}"). This pattern directly matches the vulnerable path /upload/GoodsCategory/image, where eruptName would be GoodsCategory and fieldName would be image.
-
This upload method contains logic for validating file types and sizes based on the Erupt field's configuration (edit.attachmentType() and edit.htmlEditorType()). The vulnerability type "Unrestricted Upload of File with Dangerous Type" suggests that either these validations are insufficient for the specific GoodsCategory's image field configuration, or there's a way to bypass these checks, allowing malicious files to be uploaded.
-
Without a specific patch, it's hard to pinpoint the exact line, but the upload method is the most probable location where the vulnerable processing occurs. The issue likely lies in how the file type or content is (or isn't) validated for this specific Erupt entity and field combination, leading to the execution of arbitrary code if a crafted file (e.g., a webshell) is uploaded.
Therefore, the xyz.erupt.core.controller.EruptFileController.upload function is identified as the primary vulnerable function. Other upload-related methods in the same controller (uploads, uploadHtmlEditorImage, uploadUEditorImage) might also be susceptible if they share or reuse the same flawed validation logic, but the upload method is the direct match for the described vulnerable path.