The vulnerability allows bypassing server-side upload validation in Vaadin's Upload component. The root cause lies in the state management of multi-file uploads. When a developer uses a listener on the 'upload-start' event to validate a file and decides to reject it by calling interruptUpload(), the component should stop all subsequent uploads in that batch.
The analysis of the patch bfe9e507cdcc5d90a2312c8f0162f798a29ba635 reveals the flaw. The interrupted flag, which signals that the upload process should be aborted, was being reset incorrectly. The endUpload() method, which is called after each file upload completes (or fails), contained the line interrupted = false;. In a multi-file upload scenario, this meant that after the first (rejected) file was handled, the interruption state was cleared, allowing subsequent, potentially malicious, files to be uploaded without being subject to the same validation interruption.
The fix addresses this by modifying endUpload() to only reset the interrupted flag once all active uploads (activeUploads) have finished. This ensures that the interruption state persists for the entire duration of the multi-file upload batch, correctly preventing all files after the interruption is triggered.
The primary vulnerable function is com.vaadin.flow.component.upload.Upload.endUpload due to its flawed logic. During exploitation, a call to com.vaadin.flow.component.upload.Upload.interruptUpload() would initiate the process, and the faulty logic in endUpload would lead to the bypass.