CVE-2023-49554
Executive Summary
CVE-2023-49554 is a Use-After-Free (UAF) vulnerability identified in YASM (Yet Another Assembler) version 1.3.0.86.g9def. The flaw resides in the do_directive function within the modules/preprocs/nasm/nasm-pp.c component. A remote attacker can trigger this vulnerability by providing a specially crafted input file, leading to a denial of service (DoS) condition. The vulnerability is currently unpatched, and no public proof-of-concept (PoC) or exploit code has been released. The EPSS score is 0.0%, indicating a very low probability of exploitation in the wild at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unavailable)
- Attack Vector (AV): Network (likely)
- Attack Complexity (AC): Low (likely)
- Privileges Required (PR): None (likely)
- User Interaction (UI): Required (likely, as the victim must process a malicious file)
- Scope (S): Unchanged
- Confidentiality (C): None
- Integrity (I): None
- Availability (A): High
Threat Level: Medium (due to DoS impact and lack of patch)
Deep Dive & Mechanics
The vulnerability is a classic Use-After-Free (CWE-416) in the NASM preprocessor module of YASM. The do_directive function is responsible for handling preprocessor directives (e.g., %define, %macro). When processing a malformed or specially crafted input file, the function may free a memory region but continue to hold a dangling pointer to that region. Subsequent access to this freed memory can cause a crash, leading to a denial of service.
Root Cause Analysis:
- The
do_directivefunction innasm-pp.cdoes not properly validate the state of memory after a free operation. - An attacker can craft an assembly source file that triggers a specific code path where a pointer is used after the memory it points to has been freed.
- This results in a segmentation fault or other memory corruption, crashing the YASM process.
Attack Vector:
- Remote attacker sends a malicious
.asmfile to a service or user that processes it with YASM. - No authentication required.
- User interaction is required (the victim must open or process the file).
Vulnerable vs. Patched Code
Vulnerable Code (YASM 1.3.0.86.g9def):
The vulnerable code is in modules/preprocs/nasm/nasm-pp.c within the do_directive function. The exact vulnerable lines are not publicly disclosed, but the issue is a use-after-free.
// Hypothetical vulnerable pattern
char *ptr = malloc(size);
// ... some processing ...
free(ptr);
// ... later ...
strcpy(ptr, "data"); // Use after free
Patched Code: No official patch is available. The vendor (YASM) has not released a fix. Users are advised to avoid processing untrusted files with this version.
Exploitation & Lab Setup
Red Team
Objective: Trigger a denial of service on a target system running YASM 1.3.0.86.g9def.
Lab Setup:
- Install YASM 1.3.0.86.g9def on a test system (Linux recommended).
- Create a malicious assembly file that triggers the UAF.
Exploit Steps:
- Craft a
.asmfile with a sequence of NASM preprocessor directives designed to cause a use-after-free indo_directive. - Execute:
yasm -f elf64 malicious.asm - Observe the crash (segmentation fault).
Example Malicious Input (Hypothetical):
%macro test 1
%define %%var %1
%undef %%var
%define %%var %1
%endmacro
test 1
Blue Team
Detection:
- Monitor for crashes of the
yasmprocess. - Use file integrity monitoring to detect unexpected
.asmfiles. - Implement network filtering to block known malicious file types if not required.
Mitigation:
- Do not process untrusted assembly files with YASM 1.3.0.86.g9def.
- Use a sandboxed environment for any YASM processing.
- Consider using alternative assemblers (e.g., NASM) until a patch is available.
Indicators of Compromise (IOCs)
- File Hashes: (None available, but any
.asmfile that causes a crash in YASM 1.3.0.86.g9def) - Process Behavior:
yasmprocess crashes with SIGSEGV (signal 11) - Log Entries: System logs showing
yasm[PID]: segfault at ... - Network: No network indicators (local file processing)
Detection Engineering
YARA Rule
rule CVE_2023_49554_YASM_UAF {
meta:
description = "Detects malicious assembly files targeting CVE-2023-49554"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-49554"
strings:
$macro = /%macro\s+\w+\s+\d+/ nocase
$undef = /%undef\s+\w+/ nocase
$define = /%define\s+\w+/ nocase
condition:
all of them and filesize < 10KB
}
Sigma Rule
title: YASM Process Crash Due to Use-After-Free
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects crashes of the YASM assembler process, potentially indicating exploitation of CVE-2023-49554.
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/yasm'
ExitCode: -11
condition: selection
falsepositives:
- Legitimate crashes due to malformed files
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-49554 YASM Malicious Assembly File Transfer"; flow:to_server,established; content:"%macro"; content:"%undef"; content:"%define"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Do not process untrusted assembly files with YASM 1.3.0.86.g9def.
- Short-term: Use an alternative assembler (e.g., NASM, GNU Assembler) until a patch is released.
- Long-term: Monitor the YASM project for an official patch. Apply it as soon as it becomes available.
- Compensating Controls: Run YASM in a sandboxed environment (e.g., Docker container with limited resources) to contain any DoS impact.
Valters IT
DevSecOps & Cyber Threat Intelligence