CVE-2022-40009
Critical · 9.8CVSS
9.8
EPSS
1.3%
Published
Sep 20, 2022
CISA due date
—
Cloudanix analysis
A flaw in software that displays web pages and documents can let attackers take over computers simply by getting users to view content with a specially made font file.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Use After Free
- Remediation
- No Fix Yet
- Effort
- Other
- Patch risk
- Other
What it actually does
Heap use-after-free in grow_unicode allows memory corruption that can lead to arbitrary code execution when processing crafted TrueType font data.
Why it matters to the business
Attackers can remotely compromise systems rendering web or document content containing malicious fonts, leading to full system takeover; the vulnerability affects widely deployed web rendering libraries on Debian and Ubuntu servers and desktops with public exploits available for nearly four years.
How an attack unfolds
An attacker crafts a malicious font file that triggers the use-after-free during unicode string growth in ttf processing, then serves it via a web page or document; when the victim application parses the font, the freed memory is reused for attacker-controlled data resulting in code execution. Public exploits exist and EPSS has risen 14% in the last 30 days.
How to fix it
Upgrade webkit2gtk and wpewebkit packages to the fixed versions: 2.28.4-1 on Debian 11/12/13 and 2.28.4-0ubuntu0.18.04.1 on Ubuntu 18.04 LTS. Apply vendor updates immediately and restart affected services.
How to confirm the fix worked
Verify installed package versions match or exceed the listed fixed releases, run regression tests with font parsing workloads, and confirm no crash or memory error occurs when processing the original proof-of-concept font.
Typical attack path
- Attacker prepares a specially crafted TrueType font triggering grow_unicode use-after-free
- Malicious font is delivered through a web page, document, or media file
- Target application parses the font using the vulnerable webkit2gtk/wpewebkit library
- Freed heap memory is overwritten with attacker data leading to control-flow hijacking
- Arbitrary code executes with the privileges of the rendering process
How to detect it
Search application and system logs for crashes or segmentation faults during font loading in webkit processes; examine core dumps or memory sanitizer reports referencing grow_unicode or ttf.c for evidence of prior exploitation attempts.
What your security team should do
- Prioritize patching all Debian and Ubuntu systems running webkit2gtk or wpewebkit within the next 48 hours due to public exploit availability
- Inventory all applications depending on these libraries and schedule restarts after upgrade
- Enable memory safety mitigations such as ASLR and sandboxing where available until patches are applied
- Monitor EPSS trend and exploit maturity updates for any change in urgency
The record
SWFTools commit 772e55a was discovered to contain a heap-use-after-free via the function grow_unicode at /lib/ttf.c.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:16.04:LTS | swftools | 0 | No fix |
| Ubuntu:18.04:LTS | swftools | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | swftools | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | swftools | 0 | No fix |
Related vulnerabilities
- CVE-2024-28458 Null Pointer Dereference vulnerability in swfdump in swftools 0.9.2 allows attackers to… Also affects swftools
- CVE-2024-26334 swftools v0.9.2 was discovered to contain a segmentation violation via the function… Also affects swftools
- CVE-2024-26337 swftools v0.9.2 was discovered to contain a segmentation violation via the function… Also affects swftools
- CVE-2024-26335 swftools v0.9.2 was discovered to contain a segmentation violation via the function… Also affects swftools
- CVE-2024-26339 swftools v0.9.2 was discovered to contain a strcpy parameter overlap via… Also affects swftools
- CVE-2024-26333 swftools v0.9.2 was discovered to contain a segmentation violation via the function… Also affects swftools
- CVE-2024-25165 A global-buffer-overflow vulnerability was found in SWFTools v0.9.2, in the function… Also affects swftools
- CVE-2024-22956 swftools 0.9.2 was discovered to contain a heap-use-after-free vulnerability via the… Also affects swftools