{"id":"CVE-2026-77652","aliases":["DEBIAN-CVE-2026-77652","EUVD-2026-66675","GHSA-w4q3-279c-xvrv","UBUNTU-CVE-2026-77652"],"status":"published","title":"Dia: dia: heap buffer overflow in wpg colormap parser via out-of-bounds palette index","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.\n\nIn plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:\n\n    ren-\u003epPal = g_new0(WPGColorRGB, 256);\n\nWhen handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:\n\n    bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));\n\nThe only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.\n\nA malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.\n\nExploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.\n\nAffected component: WPG parser (plug-ins/wpg/wpg-import.c).\nAffected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","severity":{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00212,"percentile":0.11593,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-122"],"published":"2026-08-26T19:21:39Z","modified":"2026-10-17T13:01:07Z","affected":[{"source":"osv","ecosystem":"Debian:12","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3+git20220525-5","0.98+git20240130-1","0.98+git20240528-1","0.98+git20240814-1","0.98+git20250126-1","0.98+git20250126-2","0.98+git20250827-1","0.98+git20250827-2","0.98+git20260221-1","0.98+git20260221-2","0.98+git20260221-3"]},{"source":"osv","ecosystem":"Debian:13","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.98+git20250126-2","0.98+git20250827-1","0.98+git20250827-2","0.98+git20260221-1","0.98+git20260221-2","0.98+git20260221-3"]},{"source":"osv","ecosystem":"Debian:14","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.98+git20250126-2","0.98+git20250827-1","0.98+git20250827-2","0.98+git20260221-1","0.98+git20260221-2","0.98+git20260221-3"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3-1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3+git20160930-6","0.97.3+git20160930-7","0.97.3+git20160930-8"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3+git20160930-8.1","0.97.3+git20160930-8.2","0.97.3+git20160930-9"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3+git20160930-9","0.97.3+git20160930-9build1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.97.3+git20220525-5build1","0.97.3+git20220525-5build2","0.97.3+git20220525-5build3","0.98+git20240130-1","0.98+git20240130-1build2","0.98+git20240130-1build3","0.98+git20240130-1build4"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.98+git20260221-1","0.98+git20260221-2","0.98+git20260221-3"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"dia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.98+git20250902-0ubuntu1","0.98+git20250902-0ubuntu2","0.98+git20260221-1"]}],"products":[{"vendor":"gnome","product":"dia"},{"vendor":"the browser company of new york","product":"dia"}],"references":[{"url":"https://access.redhat.com/security/cve/CVE-2026-77652","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2520884","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://gitlab.gnome.org/GNOME/dia/-/blob/master/plug-ins/wpg/wpg-import.c"},{"url":"https://gitlab.gnome.org/GNOME/dia/-/issues/580","tags":["exploit","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77652"},{"url":"https://github.com/advisories/GHSA-w4q3-279c-xvrv"},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-77652","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-77652","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-77652","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-77652","title":"Dia: dia: heap buffer overflow in wpg colormap parser via out-of-bounds palette index","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.\n\nIn plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:\n\n    ren-\u003epPal = g_new0(WPGColorRGB, 256);\n\nWhen handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:\n\n    bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));\n\nThe only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.\n\nA malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.\n\nExploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.\n\nAffected component: WPG parser (plug-ins/wpg/wpg-import.c).\nAffected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T19:21:39.936Z","modified":"2026-08-27T14:43:23.737Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-122"],"updated_at":"2026-11-02T14:20:15.712761Z"}],"euvd":[{"id":"EUVD-2026-66675","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.\n\nIn plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:\n\n    ren-\u003epPal = g_new0(WPGColorRGB, 256);\n\nWhen handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:\n\n    bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));\n\nThe only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.\n\nA malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.\n\nExploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.\n\nAffected component: WPG parser (plug-ins/wpg/wpg-import.c).\nAffected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T19:21:39Z","modified":"2026-08-27T14:43:23Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T18:01:28.115205Z"}],"ghsa":[{"id":"GHSA-w4q3-279c-xvrv","title":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format...","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.\n\nIn plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:\n\n    ren-\u003epPal = g_new0(WPGColorRGB, 256);\n\nWhen handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:\n\n    bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));\n\nThe only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.\n\nA malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.\n\nExploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.\n\nAffected component: WPG parser (plug-ins/wpg/wpg-import.c).\nAffected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T21:31:45Z","modified":"2026-08-26T21:31:52Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-122"],"updated_at":"2026-11-02T15:11:01.362113Z"}],"nvd":[{"id":"CVE-2026-77652","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.\n\nIn plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:\n\n    ren-\u003epPal = g_new0(WPGColorRGB, 256);\n\nWhen handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:\n\n    bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));\n\nThe only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.\n\nA malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.\n\nExploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.\n\nAffected component: WPG parser (plug-ins/wpg/wpg-import.c).\nAffected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T20:18:02.16Z","modified":"2026-08-28T15:44:39.323Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-122"],"updated_at":"2026-11-02T14:12:41.66469Z"}],"osv":[{"id":"DEBIAN-CVE-2026-77652","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer.  In plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:      ren-\u003epPal = g_new0(WPGColorRGB, 256);  When handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:      bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f));  The only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256.  A malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution.  Exploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim.  Affected component: WPG parser (plug-ins/wpg/wpg-import.c). Affected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T20:18:02.16Z","modified":"2026-10-01T03:03:42.190885363Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:46:03.502256Z"},{"id":"UBUNTU-CVE-2026-77652","description":"A heap-based buffer overflow vulnerability exists in the Dia diagram editor WPG file format importer. In plug-ins/wpg/wpg-import.c, the WPG import renderer allocates a fixed palette with:     ren-\u003epPal = g_new0(WPGColorRGB, 256); When handling a WPG_COLORMAP record, the parser reads a start index (i16) and number of colors (iNum16) from the file and reads palette data with:     bRet \u0026= (iNum16 == (int)fread(\u0026ren-\u003epPal[i16], sizeof(WPGColorRGB), iNum16, f)); The only bounds-related check is `if (i16 \u003e= 0 \u0026\u0026 i16 \u003c= iSize)`, where iSize is the WPG record size—not the palette capacity. There is no validation that i16 is less than 256 or that i16 + iNum16 does not exceed 256. A malicious WPG file can supply i16=256 and iNum16=264. That causes fread() to write 792 bytes starting at \u0026pPal[256], while the palette buffer is only 768 bytes (256 entries × 3 bytes). This overflows into adjacent heap metadata and can crash Dia (SIGABRT / malloc corruption errors) or, depending on heap layout and exploit primitives, potentially lead to arbitrary code execution. Exploitation requires convincing a user to open a crafted WPG file via Dia's file dialog, command line, or file association. No special privileges are required to deliver the file to the victim. Affected component: WPG parser (plug-ins/wpg/wpg-import.c). Affected versions: all Dia versions containing this code path (reporter tested Dia 0.98+git20260221-1; issue present on upstream master as of 2026-08-21).","status":"published","published":"2026-08-26T20:18:00Z","modified":"2026-10-17T13:01:07.84787411Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T16:57:18.015985Z"}]}}
