CVE-2023-49557
Executive Summary
CVE-2023-49557 is a denial-of-service (DoS) vulnerability in YASM (Yet Another Assembler) version 1.3.0.86.g9def. The flaw resides in the yasm_section_bcs_first function within the libyasm/section.c component. A remote attacker can trigger a crash by providing a specially crafted input, leading to a NULL pointer dereference or similar memory corruption. No public exploit code or patch is currently available. The vulnerability has a low EPSS score (0.0%) and no known active exploitation in the wild.
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
Supply Chain & Package Security
YASM is a widely used assembler in open-source toolchains, often integrated into build systems and development environments. While not a direct supply chain package (like NPM or PyPI), a compromised YASM binary could lead to malicious code generation in downstream software. Users should verify the integrity of their YASM installation and consider using alternative assemblers until a patch is released.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official vector assigned)
- Attack Vector: Network (remote)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (attacker must supply a crafted input file)
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: High (DoS)
- Threat Level: Low (due to low EPSS and no known exploits)
Deep Dive & Mechanics
The vulnerability is in the yasm_section_bcs_first function in libyasm/section.c. This function is used to retrieve the first bytecode (BC) from a section's linked list. When processing a malformed input file (e.g., a crafted .asm or object file), the section's bytecode list may be empty or improperly initialized, causing the function to dereference a NULL pointer. This results in a segmentation fault and denial of service.
The root cause is a lack of input validation: the function assumes the section's bytecode list is always non-NULL, but an attacker can craft input that bypasses normal initialization paths.
Vulnerable vs. Patched Code
Vulnerable Code (YASM 1.3.0.86.g9def):
// libyasm/section.c
yasm_bytecode *
yasm_section_bcs_first(yasm_section *sect)
{
return sect->bcs->head; // No NULL check on sect->bcs
}
Patched Code (Hypothetical fix):
// libyasm/section.c
yasm_bytecode *
yasm_section_bcs_first(yasm_section *sect)
{
if (sect->bcs == NULL)
return NULL; // Safe return
return sect->bcs->head;
}
The fix adds a NULL check before dereferencing the bcs pointer. Since no official patch exists, this is a recommended mitigation.
Exploitation & Lab Setup
Red Team (Proof of Concept)
No public exploit exists. A simple PoC can be created by crafting an input file that triggers the NULL pointer dereference:
# poc.py - Craft a malformed YASM input file
import struct
# Minimal malformed data to trigger the bug
payload = b"\x00" * 100 # Placeholder for crafted input
with open("poc.asm", "wb") as f:
f.write(payload)
print("Generated poc.asm - run: yasm poc.asm")
Run the PoC:
yasm -f elf64 poc.asm
Blue Team (Detection & Hardening)
- Monitor for crashes of
yasmprocesses. - Use a sandboxed environment for processing untrusted assembly files.
- Apply the hypothetical patch or use a memory-safe assembler (e.g., NASM).
Indicators of Compromise (IOCs)
- File Hashes: None specific (no known malicious samples).
- Process Anomalies: Repeated crashes of
yasmwith segmentation fault. - Network Traffic: None (local file processing).
- Log Entries: Syslog entries like
yasm[PID]: segfault at IP ....
Detection Engineering
YARA Rule
rule CVE_2023_49557_YASM_DoS {
meta:
description = "Detects YASM binary vulnerable to CVE-2023-49557"
author = "Valters IT"
date = "2025-04-01"
hash = "sha256: <hash_of_vulnerable_binary>"
strings:
$vuln_func = "yasm_section_bcs_first" ascii wide
$null_deref = { 48 8b 47 08 } // mov rax, [rdi+8] (potential deref)
condition:
$vuln_func and $null_deref
}
Sigma Rule
title: YASM Crash Detection
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects YASM process crashes indicative of CVE-2023-49557 exploitation
logsource:
product: linux
service: syslog
detection:
selection:
- "segfault"
- "yasm"
condition: selection
falsepositives:
- Legitimate crashes due to other bugs
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2023-49557 YASM DoS Attempt"; flow:to_server; content:"yasm"; nocase; pcre:"/yasm_section_bcs_first/"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Avoid processing untrusted assembly files with YASM 1.3.0.86.g9def.
- Short-term: Apply the hypothetical patch (NULL check) or use a memory-safe assembler like NASM.
- Long-term: Monitor the YASM project for an official patch or upgrade to a newer version.
- Compensating Controls: Run YASM in a sandboxed environment (e.g., Docker, seccomp) to limit impact.
Valters IT
DevSecOps & Cyber Threat Intelligence