webp_transform: ImageMagick runs without a security policy
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
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
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.xmlcan lower the plugin's decode limits. When it does, conversions quietly turn into pass-throughs and nothing is logged. - The
websafepolicy 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-throttlesetting 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.
- With the plugin's
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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/trafficserver
-
Bug HTTP Support
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/trafficserver#13118 ·
Los mantenedores suelen responder en 2 días
-
traffic_ctl: apply --error-level to config reload resultsPosiblemente ocupada @brbzull0 la tomó hoy. Abierto
apache/trafficserver#13832 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
header_rewrite: rm-destination after set-destination URL crashes traffic_serverPosiblemente ocupada @moonchen la tomó hace 8 días. AbiertoBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
apache/trafficserver#13798 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
apache/trafficserver#13784 ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/trafficserver
Issues similares
-
nth_root does not restore the rounding mode and can return an upper bound below the true rootAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
1 type: problem 2 scope: firmware 3 good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
SpaceTeam/STS1_COBC_SW#511 ·
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
imaaiagent/fumi#3 ·
-
[Performance]: Beam search re-materializes Result.output_token_ids from pybind once per beamAbiertoGeneral perf
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NVIDIA/TensorRT-LLM#20236 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
E3SM-Project/mam4xx#603 ·
Los mantenedores suelen responder en 1 día