The vulnerability allows users to upload an unlimited number of files through forms, leading to potential resource exhaustion and a Denial of Service (DoS) attack. The root cause is the lack of a mechanism to clean up or replace temporary files uploaded to a form field before the form is submitted.
The analysis of the provided patch (commit 9d32b089f30a42c8fd2d30832b3c90eefb5afe84) reveals the exact point of failure and the subsequent fix.
The key modified file is UploadFileEntryMVCActionCommand.java. Within this file, the inner class DDMFormUploadFileEntryHandler contains the upload method, which is responsible for processing the file upload. The patch adds a crucial piece of logic at the beginning of this method: a call to a new utility function, DLFileEntryUtil.deleteDLFileEntry. This new logic ensures that any file previously uploaded to that specific form field instance (oldFileEntryId) is deleted before the new file is processed and stored.
Before this change, the upload function would simply add new files to the document library without removing the old ones associated with the form field. This allowed for the accumulation of orphaned files if the user uploaded a file, then uploaded another to the same field, or simply navigated away from the page without submitting the form.
The newly added DeleteFileEntryMVCActionCommand.java and the corresponding frontend JavaScript changes in DocumentLibrary.es.js provide the necessary infrastructure to handle this deletion, both when a new file is uploaded and when the user navigates away from the page. However, the vulnerable function is the one that improperly handled the resource allocation, which is UploadFileEntryMVCActionCommand$DDMFormUploadFileEntryHandler.upload.