跳到正文
GitHub 安全公告库 (GHSA)·· 23 小时前精选AI 评分60

Pillow 修复 GIF 注释二次方拼接导致的 Image.open() DoS 问题

Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()

AI 导读

GitHub 安全公告指出 Pillow 的 GifImageFile._seek() 在 src/PIL/GifImagePlugin.py 中用 bytes 拼接累积 GIF 注释,使 Image.open() 耗时随注释数据量呈二次方增长,默认设置下 2 MB 文件约 5 秒、4 MB 约 35 秒、8 MB 约 3 分钟,而同样大小的普通 GIF 不到 1 秒。

为什么值得看

公告给出触发条件与实测耗时数据,并附上把 bytes 拼接改为列表 join 的补丁,便于使用 Pillow 的服务评估上传接口风险。

来源:GitHub 安全公告库 (GHSA) · github.com