s3fsS3 File System (s3fs) provides an additional file system to your Drupal site that stores files in Amazon's Simple Storage Service (S3) storage.
The module doesn't sufficiently isolate upload context between separate object(file) operations in the same request resulting in the potential for objects to be uploaded with incorrect access control list (ACL) entries or corruption through incorrect operation metadata.
This vulnerability is mitigated by the fact that an attacker must be able to trigger multiple file operations on S3FS.
Some vectors are mitigated by:
- Not enabling private:// takeover (
$settings['s3fs.use_s3_for_private'] = FALSE;) or only enabled with$settings['s3fs.upload_as_private'] = TRUE; - The deployment does not utilize
hook_s3fs_stream_open_params_alter(),hook_s3fs_upload_params_alter(),hook_s3fs_copy_params_alter(), orhook_s3fs_command_params_alter()
If both points above have always been true, all currently known vectors are mitigated.
Install the latest version:
- If you use the S3 File System module for Drupal 8.x, upgrade to s3fs 8.x-3.12
If private:// takeover is enabled without $settings['s3fs.upload_as_private'] = TRUE; audit all private object ACL's to ensure no objects include a public read ACL entry. If private objects with public read ACL are discovered, audit S3 Bucket Access logs (if enabled).
If using S3FS hooks, audit all objects to ensure any applied customization is reflected only on the intended objects.
While auditing objects, site owners may disable ACLs and utilize a Bucket Access Policy to block public access to private:// files. See the s3fs 8.x-3.12 README.txt for a sample policy. $settings['s3fs.use_s3_for_private'] = TRUE; must be configured prior to disabling ACLs.
Note: With ACLs disabled, the S3 getObjectAcl call will not report ACL entries. If this feature is enabled, consider utilizing an AWS S3 Inventory report to obtain object metadata.
- Swan Kalata (akalata) of the Drupal Security Team
- Greg Knaddison (greggles) of the Drupal Security Team
- Juraj Nemec (poker10) of the Drupal Security Team