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

オープン
#3,309 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp
領域
backend, security

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
569
フォーク
107
平均マージ
2時間 49分
マージ済み PR(30日)
397

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。