UIFC-262 Add 50 MB file upload size limit to prevent DoS attacks - #349
Conversation
- Implement client-side file size validation (reject > 50 MB before upload) - Refactor handleDrop to async/await for proper error propagation - Add helper functions: createFileSizeErrorMessage, handlePayloadTooLargeError - Sanitize backend error messages (reject HTML tags, >200 chars) to prevent XSS - Handle HTTP 413 with fallback for malformed responses - Fix validation error timing (show only after touch/submit, not immediately) - Extract HTTP_STATUS_PAYLOAD_TOO_LARGE constant - Add translations: fileTooLarge, backendRejected, network - Update CHANGELOG
29e990e to
f58db5f
Compare
- Add component tests for FileUploaderField
- Fix ReDoS vulnerability: replace /<[^>]*>/ regex with simple string checks for HTML tag detection (backendMessage.includes('<') && includes('>'))
- Fix Sonar warnings
f58db5f to
58f385a
Compare
|
Thanks @slaemmer , looking good! Having general questions:
|
|
Thanks!
|
elsenhans
left a comment
There was a problem hiding this comment.
Seems like input.value has the wrong PropType:
value: PropTypes.string
Could you please change it to object?
elsenhans
left a comment
There was a problem hiding this comment.
Seems like input.value has the wrong PropType:
value: PropTypes.string
Could you please change it to object?
Good catch! Apparently it can be either string or object in code. Changed propTypes to reflect that. As this is less than ideal though, I created a bug ticket for this. |
|



https://folio-org.atlassian.net/browse/UIFC-262