VDB
Sign up
MEDIUM5.3

GHSA-jgcf-rf45-2f8v

Silverstripe Assets Module has a DBFile::getURL() permission bypass

Quick fix

GHSA-jgcf-rf45-2f8v — silverstripe/assets: upgrade to the fixed version with the command below.

composer require silverstripe/assets:^2.4.5

Details

### Impact

Images rendered in templates or otherwise accessed via `DBFile::getURL()` or `DBFile::getSourceURL()` incorrectly add an access grant to the current session, which bypasses file permissions.

This usually happens when creating an image variant, for example using a manipulation method like `ScaleWidth()` or `Convert()`.

Note that if you use `DBFile` directly in the `$db` configuration for a `DataObject` class that doesn't subclass `File`, and if you were setting the visibility of those files to "protected", those files will now need an explicit access grant to be accessed. If you do not want to explicitly provide access grants for these files (i.e. you want these files to be accessible by default), you should use the "public" visibility.

### Reported by

Restruct web & apps

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/silverstripe/assets
Introduced in: 0Fixed in: 2.4.5
Fixcomposer require silverstripe/assets:^2.4.5
Packagist/silverstripe/assets
Introduced in: 3.0.0Fixed in: 3.1.3
Fixcomposer require silverstripe/assets:^3.1.3

References