CVE-2021-39595
High · 7.8CVSS
7.8
EPSS
1.1%
Published
Sep 20, 2021
CISA due date
—
Cloudanix analysis
A flaw in an older Flash-file processing tool can let attackers take over a computer simply by getting a user to open 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
Stack-based buffer overflow in rfx_alloc() within mem.c allows an attacker to overwrite adjacent stack memory and redirect execution flow to attacker-controlled code.
Why it matters to the business
Processing a malicious SWF file with the affected tools can result in full system compromise, data theft, or ransomware deployment on developer or analysis workstations.
How an attack unfolds
An attacker creates a specially crafted SWF file that triggers the overflow in rfx_alloc when parsed; the victim opens or processes the file with vulnerable swftools utilities, allowing the attacker to execute arbitrary code with the privileges of the tool.
How to fix it
Update swftools to a version newer than 20200710 if a fix becomes available; otherwise replace the tool with a maintained alternative and avoid processing untrusted SWF content.
How to confirm the fix worked
Confirm the installed swftools version exceeds 20200710; recompile from source with stack-protection flags and test against known proof-of-concept inputs to verify the overflow is no longer reachable.
Typical attack path
- Craft malicious SWF file containing oversized input to trigger rfx_alloc overflow
- Deliver the file via email, web download, or shared storage
- Victim processes the file using any swftools command-line utility
- Overflow overwrites return address and executes attacker-supplied shellcode
- Attacker establishes persistence or exfiltrates data
How to detect it
Search process-creation and file-access logs for swftools utilities handling files from untrusted sources; monitor for segmentation faults or unexpected child processes spawned by swftools binaries.
What your security team should do
- Immediately restrict swftools usage to trusted input only
- Add swftools binaries to application allow-lists with strict sandboxing
- Monitor upstream project or packaging channels for any security updates
- Replace swftools workflows with modern, maintained equivalents
The record
An issue was discovered in swftools through 20200710. A stack-buffer-overflow exists in the function rfx_alloc() located in mem.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