Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

webp_transform: ImageMagick runs without a security policy

Aperta
#13,774 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
2k
Fork
878
Merge medio
3g 15h
PR unite (30g)
94

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/trafficserver

Tutte le issue di apache/trafficserver

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.