Image size ignores EXIF orientation, and the SVG sanitizer keeps external references

Abierto
#3,309 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
backend, security

Línea de trabajo

Read src/plugins/FluentCMS.Plugins.Media/ImageSize.cs, MediaService.cs, SkiaImageProcessor.cs, and SvgDocument.cs, then review linked issue #3281 because it changes the same image processing. Trace how dimensions and SVG references are handled, and check the media tests. Done means EXIF-oriented dimensions are reported correctly, existing assets are backfilled, external SVG references and escaped @import are removed, and each behavior has a test.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

plugin type:bug

Problem

  1. Stored width and height ignore EXIF orientation. The size is read from the raw header (src/plugins/FluentCMS.Plugins.Media/ImageSize.cs:65-122, used at MediaService.cs:927), while transforms swap for a turned image (SkiaImageProcessor.cs:41,99). A portrait phone JPEG reports its width and height swapped to API consumers.
  2. The SVG sanitizer keeps external references. Remote href/xlink:href, <use>, <image> and url(https://…) are kept; only javascript:, vbscript: and non-image data: are dropped (SvgDocument.cs:133-153). @import is removed by a string match (:155-159) that a CSS escape such as @\69mport passes. The CSP sandbox covers a file served by the CMS (MediaEndpoints.cs:30,165-167), not an inlined SVG or a CDN that drops the header.

Proposal

  • Take the size from IImageProcessor.IdentifyAsync; backfill existing assets with a job.
  • Allow only same-document #fragment references, strip remote url(), and match @import after unescaping.

Done together with #3281, which changes the same image processing.

Acceptance

  • An image with a turned EXIF orientation reports the size it displays at
  • Existing assets are corrected by the backfill
  • A sanitized SVG contains no reference outside the document
  • An escaped @import is removed
  • Tests for each

Found in the code review of 17 Nov 2026.

Lenguaje dominante
C#
Estrellas
569
Forks
107
Merge medio
2 h 49 min
PR fusionados (30 d)
397

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluentcms/FluentCMS

Todos los issues de fluentcms/FluentCMS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.