Skip to content

Commit 1f02641

Browse files
Update docs/handbook/security.rst
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1 parent 114e4d5 commit 1f02641

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/handbook/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ Pillow does not remove hidden data (JPEG comments, PNG text chunks, appended
8181
bytes) when re-saving. An attacker can embed data that survives the
8282
encode-decode cycle invisibly.
8383

84-
*Mitigations:* to guarantee a clean output, load pixel data via
85-
``image.tobytes()`` and rebuild the image from raw bytes before saving.
84+
*Mitigations:* to guarantee a clean output when saving, create a new image instance via
85+
``image.copy()`` and delete the ``image.info`` contents.
8686

8787
**T-3 — Supply chain tampering**
8888

0 commit comments

Comments
 (0)