fontforge: patch CVE-2025-15275

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-15275

Pick the patch that mentions this vulnerability ID explicitly.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
Gyorgy Sarvari
2026-02-26 15:46:23 +01:00
parent 3a9f929fb0
commit 4e091b47f7
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,33 @@
From dcaa8397934419e3f1fffd8a4bdd68de87484d9d Mon Sep 17 00:00:00 2001
From: Ahmet Furkan Kavraz
<55850855+ahmetfurkankavraz@users.noreply.github.com>
Date: Fri, 9 Jan 2026 16:58:23 +0100
Subject: [PATCH] Fix CVE-2025-15275: Heap buffer overflow in SFD image parsing
(#5721)
Fixes: CVE-2025-15275 | ZDI-25-1189 | ZDI-CAN-28543
Co-authored-by: Ahmet Furkan Kavraz <kavraz@amazon.com>
CVE: CVE-2025-15275
Upstream-Status: Backport [https://github.com/fontforge/fontforge/commit/7195402701ace7783753ef9424153eff48c9af44]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
fontforge/sfd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fontforge/sfd.c b/fontforge/sfd.c
index 99d92b051..25a81c0b4 100644
--- a/fontforge/sfd.c
+++ b/fontforge/sfd.c
@@ -3714,6 +3714,10 @@ static ImageList *SFDGetImage(FILE *sfd) {
getint(sfd,&image_type);
getint(sfd,&bpl);
getint(sfd,&clutlen);
+ if ( clutlen < 0 || clutlen > 256 ) {
+ LogError(_("Invalid clut length %d in sfd file, must be between 0 and 256"), clutlen);
+ return NULL;
+ }
gethex(sfd,&trans);
image = GImageCreate(image_type,width,height);
base = image->list_len==0?image->u.image:image->u.images[0];
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https \
file://CVE-2024-25081-25082.patch \
file://CVE-2025-15269.patch \
file://CVE-2025-15270.patch \
file://CVE-2025-15275.patch \
"
S = "${WORKDIR}/git"