Skip to content

Commit 49ce662

Browse files
aclark4lifeCopilot
andauthored
Update docs/handbook/security.rst
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 89ebbc7 commit 49ce662

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

docs/handbook/security.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,12 @@ Opening an EPS file invokes the system Ghostscript binary (``gs``) via
189189
``subprocess``. Ghostscript has a long history of sandbox-escape CVEs
190190
permitting arbitrary code execution from malicious PostScript.
191191

192-
*Mitigations:* **block EPS files** at the application input layer; if EPS must
193-
be supported, run Ghostscript in a fully isolated sandbox with no network and
194-
no sensitive mounts; unregister the plugin if unused::
195-
196-
from PIL import Image, EpsImagePlugin
197-
Image.OPEN.pop("EPS", None)
198-
192+
*Mitigations:* **block EPS files** at the application input layer before
193+
passing files to Pillow; if EPS must be supported, run Ghostscript in a fully
194+
isolated sandbox with no network and no sensitive mounts. Pillow does not
195+
provide a stable public API for unregistering individual format plugins, so do
196+
not rely on mutating internal registries such as ``Image.OPEN`` as a security
197+
control.
199198
**E-3 — ``ImageMath.unsafe_eval()`` code injection**
200199

201200
:py:meth:`~PIL.ImageMath.unsafe_eval` calls Python's built-in ``eval()`` with

0 commit comments

Comments
 (0)