CVE-2026-3391 Overview
A security flaw has been discovered in FascinatedBox lily up to version 2.3. The vulnerability impacts the clear_storages function in the file src/lily_emitter.c. The manipulation results in an out-of-bounds read condition. This attack requires local access to exploit. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.
Critical Impact
Local attackers with access to systems running Lily language interpreter can trigger out-of-bounds read conditions, potentially leading to information disclosure or application crashes.
Affected Products
- lily-lang lily versions up to 2.3
- Applications utilizing the Lily programming language interpreter
- Development environments with Lily language support
Discovery Timeline
- 2026-03-01 - CVE CVE-2026-3391 published to NVD
- 2026-03-04 - Last updated in NVD database
Technical Details for CVE-2026-3391
Vulnerability Analysis
This vulnerability is classified as an out-of-bounds read (CWE-125) affecting the memory buffer operations (CWE-119) within the Lily programming language interpreter. The flaw exists in the clear_storages function located in src/lily_emitter.c, where improper bounds checking allows reading memory beyond allocated buffer boundaries.
Out-of-bounds read vulnerabilities occur when a program reads data past the boundary of the intended buffer. In the context of Lily's emitter component, this can lead to exposure of sensitive memory contents or cause unexpected behavior when processing crafted input. The vulnerability requires local access to exploit, limiting its attack surface but still posing a risk in shared computing environments or when processing untrusted Lily source files.
Root Cause
The root cause lies in insufficient boundary validation within the clear_storages function. When this function processes storage clearing operations, it fails to properly validate array indices or buffer lengths before performing read operations. This allows an attacker to craft specific input that causes the interpreter to access memory locations outside the intended buffer boundaries.
Attack Vector
The attack requires local access to the target system. An attacker must be able to execute Lily code or provide specially crafted Lily source files to the interpreter. The exploitation path involves creating malicious Lily code that triggers the vulnerable code path in clear_storages, causing the interpreter to read beyond allocated memory regions.
A reproducible example has been documented in the GitHub Issue #383. The vulnerability can be triggered by crafting specific Lily language constructs that manipulate storage operations in unexpected ways, leading to the out-of-bounds read condition. Technical details and a reproduction case are available in the GitHub reproducible example.
Detection Methods for CVE-2026-3391
Indicators of Compromise
- Unexpected crashes or segmentation faults in Lily interpreter processes
- Memory access violations reported in system logs when executing Lily code
- Anomalous memory read patterns detected by memory sanitizers (ASan/MSan)
Detection Strategies
- Deploy memory sanitizer tools (AddressSanitizer, MemorySanitizer) when running Lily interpreter in development or testing environments
- Monitor system logs for segmentation fault signals (SIGSEGV) associated with Lily interpreter processes
- Implement file integrity monitoring for Lily source files to detect injection of malicious code
Monitoring Recommendations
- Enable detailed logging for Lily interpreter execution in production environments
- Configure crash dump collection to capture memory state during unexpected terminations
- Establish baseline behavior patterns for Lily interpreter resource usage to detect anomalies
How to Mitigate CVE-2026-3391
Immediate Actions Required
- Restrict local access to systems running Lily interpreter to trusted users only
- Avoid processing untrusted Lily source files until a patch is available
- Consider isolating Lily interpreter execution in sandboxed environments
- Monitor the vendor's GitHub repository for security updates
Patch Information
No official patch is currently available from the vendor. The project was informed of the vulnerability through GitHub Issue #383 but has not yet responded. Users should monitor the official repository for updates and apply patches as soon as they become available.
Workarounds
- Run Lily interpreter with reduced privileges using OS-level sandboxing mechanisms
- Implement input validation to filter potentially malicious Lily source files before execution
- Use containerization (Docker, Podman) to isolate Lily interpreter from sensitive system resources
# Example: Run Lily interpreter in a restricted sandbox (Linux)
firejail --noprofile --quiet lily script.lily
# Alternative: Use Docker to isolate execution
docker run --rm -v $(pwd):/app:ro lily-container lily /app/script.lily
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


