{"id":"CVE-2026-112891","kind":"vulnerability","aliases":["CVE-2026-112891","GHSA-fc9g-5qg7-mf45"],"related":[],"title":"Pillow: Quadratic GIF comment copying during save","description":"On Pillow 12.3.0 and upstream `main` (`ad277e2761b489681e71b51e91367d46b0ceabb9`), a GIF with a long comment makes `_get_global_header()` copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. I suggest provisional **Moderate** severity for crafted-image CPU denial of service, with CVSS-B 6.9 assuming a network service automatically opens unauthenticated uploads and they are resaved as GIFs; impact depends on input-size, concurrency, and worker CPU limits.","summary":"Pillow's GIF saver copies portions of a long comment repeatedly, so saving a crafted GIF takes quadratic CPU time. An attacker who can get a service to re-save an uploaded GIF can tie up CPU, causing denial of service.","severity":"medium","cvss":6.9,"epss":0.003710000077262521,"exploited":false,"exploited_at":null,"products":[{"name":"pillow","fixed":["13.0.0"],"affected":">= 9.2.0, < 13.0.0","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-407","image-upload","package","pillow","python","self-hosted"],"not_affected_if":["no-untrusted-gif-save","pillow-13-or-later","pillow-below-9.2.0"],"how_to_check":"pip show pillow (affected if version >= 9.2.0 and < 13.0.0)\nCheck whether the app saves uploaded GIFs with Pillow (Image.save with format GIF) and whether it preserves comments from input images","fix":"Upgrade pillow to 13.0.0 or later.\nIf an upgrade is not possible, do not re-save untrusted GIFs or cap upload size and worker CPU time.","status":"open","published_at":"2026-10-19T22:17:08+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","triaged_at":"2026-10-23T20:10:16+00:00","updated_at":"2026-10-23T21:57:19+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-23T20:10:16Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade pillow to 13.0.0 or later.\nIf an upgrade is not possible, do not re-save untrusted GIFs or cap upload size and worker CPU time.","summary":"Pillow's GIF saver copies portions of a long comment repeatedly, so saving a crafted GIF takes quadratic CPU time. An attacker who can get a service to re-save an uploaded GIF can tie up CPU, causing denial of service.","category":"package","who_cares":["python","pillow","image-upload","self-hosted"],"confidence":0.8,"analyst_note":"","how_to_check":"pip show pillow (affected if version >= 9.2.0 and < 13.0.0)\nCheck whether the app saves uploaded GIFs with Pillow (Image.save with format GIF) and whether it preserves comments from input images\nunknown","needs_analyst":false,"not_affected_if":["no-untrusted-gif-save","pillow-below-9.2.0","pillow-13-or-later"],"severity_if_unknown":"medium"},"cost_usd":0.000395,"input_tokens":2151,"output_tokens":359,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-112891':10A,18A '-2026':9A,17A '-407':21B '12.3.0':75C '5qg7':14A '6.9':122C 'ad277e2761b489681e71b51e91367d46b0ceabb9':79C 'assum':123C 'attack':52B 'automat':127C 'b':121C 'carri':100C 'caus':69B 'comment':4A,40B,85C,94C,99C 'concurr':143C 'copi':5A,35B,90C 'cpu':49B,68B,114C,146C 'craft':45B,112C 'crafted-imag':111C 'cve':8A,16A 'cvss':120C 'cvss-b':119C 'cwe':20B 'denial':70B,115C 'depend':138C 'fc9g':13A 'get':55B,87C 'ghsa':12A 'ghsa-fc9g-5qg7-mf45':11A 'gif':3A,33B,46B,64B,81C,136C 'global':88C 'header':89C 'host':30B 'imag':23B,104C,113C 'image-upload':22B 'impact':137C 'includ':98C 'input':141C 'input-s':140C 'limit':147C 'long':39B,84C 'main':78C 'make':86C 'mf45':15A 'moder':108C 'network':125C 'open':128C 'packag':25B 'pillow':1A,19A,26B,31B,74C 'portion':36B,91C 'provision':107C 'python':27B 'quadrat':2A,48B 're':60B 're-sav':59B 'repeat':41B,95C 'resav':134C 'save':7A,43B,61B,97C 'saver':34B 'self':29B 'self-host':28B 'servic':57B,72B,117C,126C 'sever':109C 'size':142C 'suggest':106C 'take':47B 'tie':66B 'time':50B 'unauthent':129C 'untrust':103C 'upload':24B,63B,130C 'upstream':77C 'worker':145C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-19T22:17:08+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"security-advisories@github.com","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-fc9g-5qg7-mf45","url":"https://github.com/advisories/GHSA-fc9g-5qg7-mf45","severity":"medium","published_at":"2026-10-21T20:38:43+00:00","modified_at":"2026-10-21T20:38:43+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","fetched_at":"2026-10-23T19:11:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-112891","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112891","severity":null,"published_at":"2026-10-19T22:17:08+00:00","modified_at":"2026-10-20T19:48:50+00:00","first_seen_at":"2026-10-23T21:57:19+00:00","fetched_at":"2026-10-23T22:28:57+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}