S3 File System CORS Upload
The module gives the browser too much power when uploading files. Someone with an ordinary account could replace existing files in the storage service that they normally would not be allowed to change. They could overwrite files but could not read any hidden information.
- Who could do thisOnly someone with a login on your site.
- Does it apply to youA site is affected if an attacker has access to a form that uses this specific file upload feature.
- Has it been used in attacksNo sign of it.
- How urgentDrupal rates this moderately critical. Include it in your next routine update, within the month.
Tell your developerUpdate S3 File System CORS Upload to 8.x-1.4.
For developers: what the fix changed
The fix moves the S3 upload policy generation from the form element into a new `UploadPolicy` service and changes the policy condition from a `starts-with` prefix to an exact `key` match. This ensures the browser can only upload to the specific file key issued, preventing users from overwriting other files in the bucket.
Also in this release Added kernel tests, fixed server-side validation, and added support for Drupal 12.
.cspell-project-words.txt+3 −1.gitlab-ci.yml+1 −1s3fs_cors.info.yml+1 −1s3fs_cors.install+7 −0s3fs_cors.js+2 −2 fixs3fs_cors.module+0 −30s3fs_cors.services.yml+3 −0src/Controller/AjaxController.php+60 −22 fixsrc/Element/S3fsCorsFile.php+21 −106 fixsrc/Form/S3fsCorsAdminForm.php+1 −1src/Plugin/Field/FieldWidget/S3fsCorsFileWidget.php+1 −1src/Plugin/Field/FieldWidget/S3fsCorsImageWidget.php+1 −1