FileUpload filenames with client-controlled extensions can be used for XSS
概要
The FileUpload component generated random storage filenames by combining a ULID with the extension from the client-provided filename. File type validation uses the file's detected MIME type, so a file accepted as an image could still be stored with an active extension such as .html. The Spatie m...
影響パッケージ
| 種類 | パッケージ | 影響を受ける版 | 直った版 |
|---|---|---|---|
| composer | filament/forms |
>= 3.0.0, < 3.3.56 |
>= 3.3.56 |
| composer | filament/forms |
>= 4.0.0, < 4.15.0 |
>= 4.15.0 |
| composer | filament/forms |
>= 5.0.0, < 5.10.0 |
>= 5.10.0 |
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
The FileUpload component generated random storage filenames by combining a ULID with the extension from the client-provided filename. File type validation uses the file's detected MIME type, so a file accepted as an image could still be stored with an active extension such as .html. The Spatie media library rich editor attachment provider used the same naming behavior.
If uploads are stored on a public disk and served from the application's origin with a content type based on the filename extension, an authenticated uploader could upload a polyglot file that executes JavaScript when another user opens its URL. This issue does not require preserveFilenames() or a custom filename callback. Those explicit options continue to accept user-controlled filenames and should only be used with trusted users.
出典: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
参照URL
- GITHUB_REPO_ADVISORY filamentphp/filament