🎨 Expanded file upload allowlist with non-executable formats#27677
🎨 Expanded file upload allowlist with non-executable formats#27677allouis merged 1 commit intoTryGhost:mainfrom
Conversation
ref TryGhost#26869 - the allowlist introduced in TryGhost#26869 protects against executable content on the shared CDN domain, but rejects many legitimate non-executable formats that worked before (camera RAW files, common archive formats, modern image/video containers, 3D/CAD formats, etc.) - the additions are safe because the storage adapter's `getStorageContentType()` already falls back to `application/octet-stream` for any extension whose MIME type is not on the browser-renderable allowlist, forcing a download rather than rendering or executing the file - new extensions cover photography (.np3, .nef, .cr2, .cr3, .arw, .raf, .orf, .rw2, .dng, .tif, .tiff, .bmp, .heic, .heif, .avif), audio (.flac, .aac, .aif, .aiff, .opus, .mid, .midi), video (.webm, .mkv, .avi, .m4v), archives (.7z, .rar, .gz, .tgz, .tar, .bz2), 3D/design (.stl, .obj, .glb, .gltf, .fbx, .blend, .ai, .eps, .xcf), fonts (.ttf, .eot), data/docs (.toml, .tsv, .geojson, .vcf, .numbers, .odp, .ppt, .fb2) - sorted the array alphabetically for easier future maintenance - updated the importer glob test to match the expanded list
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe pull request expands the supported file upload extensions in the Ghost configuration. The 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ref #26869
getStorageContentType()already falls back toapplication/octet-streamfor any extension whose MIME type is not on the browser-renderable allowlist, forcing a download rather than rendering or executing the fileGot some code for us? Awesome 🎊!
Please take a minute to explain the change you're making:
Please check your PR against these items:
We appreciate your contribution! 🙏