Simplify how 'allow all extensions' file upload validation works

Created on 22 November 2023, 7 months ago
Updated 1 May 2024, about 2 months ago

Problem/Motivation

The 'allow all extensions' behaviour has some quirks:

Steps to reproduce

Proposed resolution

Provide an explicit flag to allow all extensions on the \Drupal\file\Plugin\Validation\Constraint\FileExtensionConstraint so the FileExtensionConstraintValidator can just skip if a flag is set.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
File moduleΒ  β†’

Last updated 2 days ago

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kim.pepper
  • Merge request !5499#3403253 Simplify allow all extensions β†’ (Open) created by kim.pepper
  • Pipeline finished with Failed
    7 months ago
    Total: 670s
    #53603
  • Pipeline finished with Failed
    7 months ago
    Total: 717s
    #58710
  • Pipeline finished with Failed
    7 months ago
    Total: 663s
    #58718
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia
  • Pipeline finished with Failed
    7 months ago
    Total: 952s
    #60196
  • Pipeline finished with Failed
    4 months ago
    Total: 499s
    #111131
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I don't think we should simplify it at all. I think we need to make it harder. Ideally only with the contrib module "Bad judgement" installed. At the very least we should prevent it from working in core unless the setting allow_insecure_uploads is set to true. Because if you set it to any empty string you are allowing insecure uploads... yes by default nothing from the \Drupal\Core\File\FileSystemInterface::INSECURE_EXTENSIONS list but still everything else... like I'm pretty sure I could exploit being able to upload an htm file and having inline JS. If I can trick a logged in user to visit that URL... profit.

Production build 0.69.0 2024