Filter SVGs before uploading by default

Created on 17 December 2024, 5 days ago

Problem/Motivation

SVGs are very powerful tools. They can include malicious code. As part of robust protection against malicious uploads, Drupal could filter (sanitize) SVG files on upload.

In general Drupal handles input as:

  1. validate input to be appropriate for a field - e.g. is a number for a number field, filesize is within the limit - and lets the user fix any validation problems on the client side
  2. stores the original content provided by a user
  3. filters content on output to mitigate security attacks

However, that strategy isn't as appropriate in the case of public files since they are generally served directly by the webserver, avoiding a Drupal bootstrap, and, therefore, cannot be filtered by Drupal at the time of display.

Steps to reproduce

Upload a malicious SVG. Drupal accepts it and will let people download it and upload it to a new site.

Proposed resolution

Integrate a tool (perhaps SVG Sanitizer β†’ ) into the upload process.

Remaining tasks

Evaluate and decide on a tool for this purpose.
Add it.

User interface changes

TBD.

Introduced terminology

TBD.

API changes

TBD.

Data model changes

TBD.

Release notes snippet

TBD.

✨ Feature request
Status

Postponed

Version

11.1 πŸ”₯

Component

file system

Created by

πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

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

Comments & Activities

Production build 0.71.5 2024