Security Vulnerability Report
中文
CVE-2025-50951 CVSS 6.5 MEDIUM

CVE-2025-50951

Published: 2025-10-23 16:16:34
Last Modified: 2025-10-27 20:17:07

Description

FontForge v20230101 was discovered to contain a memory leak via the utf7toutf8_copy function at /fontforge/sfd.c.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:fontforge:fontforge:2023-01-01:*:*:*:*:*:*:* - VULNERABLE
FontForge v20230101

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-50951 PoC - FontForge Memory Leak in utf7toutf8_copy // This PoC demonstrates the memory leak vulnerability in FontForge // when processing a malicious SFD file with UTF-7 encoded strings #include <stdio.h> #include <stdlib.h> #include <string.h> // Simulate the vulnerable utf7toutf8_copy function behavior char* vulnerable_utf7toutf8_copy(const char* utf7_input) { // Allocate memory for UTF-8 output char* utf8_output = (char*)malloc(1024); if (utf8_output == NULL) { return NULL; } // Simulate conversion (simplified) strcpy(utf8_output, utf7_input); // BUG: Memory leak - utf8_output is not freed before return // In the real vulnerability, this function fails to free allocated memory // in certain error paths or after conversion completes return utf8_output; } // Trigger the memory leak multiple times void trigger_memory_leak(int iterations) { const char* malicious_utf7 = "+ADw-script+AD4-alert('CVE-2025-50951')+ADsAPA-/script+AD4-"; for (int i = 0; i < iterations; i++) { char* result = vulnerable_utf7toutf8_copy(malicious_utf7); // Memory is leaked here - result is never freed printf("Iteration %d: Memory allocated but not freed\n", i); } } int main() { printf("CVE-2025-50951 PoC - FontForge Memory Leak\n"); printf("Triggering memory leak in utf7toutf8_copy function...\n\n"); trigger_memory_leak(1000); printf("\nMemory leak demonstration complete.\n"); printf("Each iteration allocated 1024 bytes that were never freed.\n"); printf("Total leaked: ~1MB of memory.\n"); return 0; } // To trigger the actual vulnerability: // 1. Create a malicious SFD file with UTF-7 encoded strings // 2. Open the file with vulnerable FontForge version v20230101 // 3. Monitor memory usage - it will continuously increase

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-50951", "sourceIdentifier": "[email protected]", "published": "2025-10-23T16:16:33.703", "lastModified": "2025-10-27T20:17:06.820", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "FontForge v20230101 was discovered to contain a memory leak via the utf7toutf8_copy function at /fontforge/sfd.c."}], "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:R/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-401"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:fontforge:fontforge:2023-01-01:*:*:*:*:*:*:*", "matchCriteriaId": "B99161BD-08DE-4C34-9E08-B394983B952C"}]}]}], "references": [{"url": "https://github.com/fontforge/fontforge/pull/5495", "source": "[email protected]", "tags": ["Patch"]}]}}