4.41.4: XMP allocation fix and security documentation
Security
- Documented that passing a string to
load()makes ExifReader treat it as a URL or a local file path and perform a network request or a file read, so an untrusted string must never be passed to it. Passing the image bytes instead avoids server-side request forgery and local file access (GHSA-mjwm-rcx3-79hc). - Documented that all returned metadata is untrusted input. Tag values and the raw XMP packet come from the image unchanged and can contain HTML-like markup, so they must be escaped or sanitized before being inserted into a page as HTML to avoid cross-site scripting (GHSA-hhgj-2jxm-r7x6).
- Fixed a denial-of-service vulnerability where a crafted image could declare an XMP metadata block far larger than the file itself and make the synchronous parser allocate memory proportional to that declared size instead of to the actual data. The XMP block size is now bounded to the bytes that are really present (GHSA-q53f-v5gx-7j78).
Full Changelog: v4.41.3...v4.41.4