Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

webp_transform: ImageMagick runs without a security policy

Abierto
#13,774 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
security

Línea de trabajo

Start at the webp_transform initialization path and inspect has_signature_for() plus the existing ImageMagick setup. Trace SetMagickSecurityPolicy() behavior and host-policy interactions, including process-wide effects on other ImageMagick users. Done means the plugin enforces the stated coder, delegate, filter, path, frame, and limit policy, logs incompatible host settings, and disables itself when installation or required formats fail.

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

Descripción

Plugins

Problem

webp_transform passes origin response bodies to ImageMagick, which chooses a coder by sniffing the bytes. The plugin never restricts ImageMagick, so the effective policy is whatever policy.xml the host has. If none is found, ImageMagick's built-in default allows everything.

Today has_signature_for() only lets through bodies that start with a JPEG, PNG or WebP signature, so this is a defense-in-depth gap rather than a known hole. But nothing inside ImageMagick enforces that restriction. If any path ever reached it, ImageMagick would still parse SVG, MSL, PostScript (via Ghostscript), TIFF, MNG and others. MNG and JNG are part of the same module as PNG.

Related issues:

  • Animated WebP: ImageMagick decodes every frame before Magick++ keeps the first, so the work grows with the frame count up to the resource limits.
  • Host limits: a host policy.xml can lower the plugin's decode limits. When it does, conversions quietly turn into pass-throughs and nothing is logged.
  • The websafe policy doesn't fit. ImageMagick's own websafe policy isn't a drop-in fix:
    • With the plugin's disk(0), its 8000-pixel area limit fails nearly every image.
    • Its dynamic-throttle setting sleeps on event threads.
    • It still allows GIF, BMP, TIFF, MNG and JNG.
    • It's a build-time option only from ImageMagick 7.1.1-16.

Proposal

At init, install a policy specific to the plugin with SetMagickSecurityPolicy(), which is available since IM6 6.9.10 and IM7 7.0.10:

  • Allow only the coders and modules the plugin uses: read JPEG, PNG and WebP; write JPEG and WebP.
  • Deny delegates (external programs), filters and file paths.
  • Limit decodes to single-frame images.
  • Never re-allow anything the host policy denies. If the host denies a format the plugin needs, log an error and disable the plugin.
  • Check the result after installing the policy, and disable the plugin if it didn't take effect.
  • At startup, warn about host settings that quietly prevent conversions: lowered limits, a time limit, dynamic throttling, or a small max-memory-request.

The policy applies to the whole process, so it would also restrict other ImageMagick users in the same traffic_server, such as the experimental magick plugin. That should be documented.

Lenguaje dominante
C++
Estrellas
2k
Forks
878
Merge medio
3 d 15 h
PR fusionados (30 d)
94

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 apache/trafficserver

Todos los issues de apache/trafficserver

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.