CVE-2021-42199
High · 7.8CVSS
7.8
EPSS
1.2%
Published
Jun 2, 2022
CISA due date
—
Cloudanix analysis
A bug in a program that handles old Flash files can let attackers take over a computer when someone opens a specially made file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap buffer overflow in swf_FontExtract_DefineTextCallback within swftext.c that permits attacker-controlled data to overwrite adjacent heap memory and achieve arbitrary code execution.
Why it matters to the business
Processing a malicious SWF file with the affected tool can result in full system compromise, data theft, or deployment of additional malware on developer or analyst workstations.
How an attack unfolds
An attacker creates a crafted SWF containing oversized or malformed text records, convinces a victim to run an swftools command such as swfextract or font extraction against the file, and the overflow is triggered during DefineText callback processing to redirect execution to attacker-supplied shellcode.
How to fix it
Upgrade swftools to the latest available version or a patched fork that resolves the overflow in swftext.c; where no upstream fix exists, replace the tool with an alternative SWF processor and remove swftools from build and analysis pipelines.
How to confirm the fix worked
Confirm swftools version is newer than the 20201222 snapshot; run the affected font-extraction commands against known-bad SWF samples in a sandbox and verify absence of crashes or unexpected memory writes.
Typical attack path
- Generate malicious SWF file that triggers the overflow in DefineText handling
- Deliver the file via email, download link, or shared repository
- Victim executes swftools utility against the file
- Heap corruption leads to code execution in the context of the running user
How to detect it
Review process execution logs and crash dumps for swftools utilities; correlate file-access events on .swf files immediately preceding abnormal termination or unexpected child-process creation.
- swf_FontExtract_DefineTextCallback
- swftext.c
- swfextract.*\.swf
What your security team should do
- Remove or isolate swftools from any workflow that accepts untrusted SWF input
- Add swftools binaries to application allow-listing only after integrity verification
- Scan source repositories and CI pipelines for references to the vulnerable swftext.c functions
- Monitor EPSS and exploit-availability feeds for increases in weaponization
The record
An issue was discovered in swftools through 20201222. A heap buffer overflow exists in the function swf_FontExtract_DefineTextCallback() located in swftext.c. It allows an attacker to cause code execution.
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