webp_transform: ImageMagick runs without a security policy
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 2k
- フォーク
- 881
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 81
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/trafficserver のほかの issue
-
VIA_SERVER_RESULT and VIA_PROXY_RESULT are never set in handle_no_cache_operation_on_forward_server_response() for 206 Partial Content and the default branch (9.2.x)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンBug HTTP Support
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
apache/trafficserver#13118 ·
メンテナーはふだん 2 日以内に返信
-
rate_limit: SNI limiter rejects clients on its exclude list instead of exempting them対応中かも @bryancall が 1 日前に担当しました。 オープンBug Plugins rate_limit
apache/trafficserver#13851 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Branch build clones: mirror stalls, clone timeout and controller memory対応中かも @bryancall が 3 日前に担当しました。 オープンCI
apache/trafficserver#13839 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
traffic_ctl: apply --error-level to config reload results対応中かも @brbzull0 が 4 日前に担当しました。 オープン
apache/trafficserver#13832 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
header_rewrite: rm-destination after set-destination URL crashes traffic_server対応中かも @moonchen が 12 日前に担当しました。 オープンBug Crash header_rewrite Plugins
apache/trafficserver#13800 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
apache/trafficserver の issue をすべて見る
似ている issue
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
improvement ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ihhub/fheroes2#11062 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement question
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DarkStarSystems/pcons#224 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
LizardByte/Sunshine#5953 ·
メンテナーはふだん 1 日以内に返信