Media Alias Display
In some cases files may be served with a public cache header when they should be uncacheable. Anyone with no login could view cached versions of files with information they should not be able to access. They could not alter any files.
- Who could do thisAnyone visiting the site. No login needed.
- Does it apply to youDrupal must be configured to handle non public files using a custom or contributed module providing an additional file scheme, and an attacker must know to request a file that has previously been requested by a more privileged user and is still cached.
- 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 Media Alias Display to 3.0.2 or 2.1.2, whichever branch you are on.
For developers: what the fix changed
Updates DisplayController::__invoke() in src/Controller/DisplayController.php to check file_additional_public_schemes when determining if a file response should be public or private. This ensures files that are not public are not cached.
Also in this release Adds an event subscriber to restore cache headers for media responses, updates CI configuration, and refactors tests.
.gitlab-ci.yml+1 −46media_alias_display.services.yml+4 −0src/Controller/DisplayController.php+13 −0 fixsrc/EventSubscriber/MediaAliasDisplayResponseSubscriber.php+51 −0src/Response/CacheableBinaryFileResponse.php+3 −5