CVE-2020-27372
📋 TL;DR
A buffer overflow vulnerability in Brandy Basic V Interpreter 1.21 allows attackers to execute arbitrary code by exploiting the run_interpreter function. This affects systems running the vulnerable interpreter, potentially enabling remote code execution. Users of Brandy Basic V Interpreter 1.21 are at risk.
💻 Affected Systems
- Brandy Basic V Interpreter
📦 What is this software?
Brandy by Brandy Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with full system compromise, allowing attackers to install malware, steal data, or create persistent backdoors.
Likely Case
Local privilege escalation or denial of service through crafted BASIC programs that trigger the buffer overflow.
If Mitigated
Limited impact if the interpreter runs in a sandboxed environment with restricted permissions.
🎯 Exploit Status
Buffer overflow vulnerabilities in interpreters are commonly exploited. The public bug report suggests exploitation details are available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Version 1.22 or later
Vendor Advisory: https://sourceforge.net/p/brandy/bugs/10/
Restart Required: No
Instructions:
1. Download the latest version from the Brandy project page. 2. Replace the existing interpreter binary with the updated version. 3. No restart required for the operating system.
🔧 Temporary Workarounds
Restrict interpreter permissions
linuxRun the interpreter with reduced privileges using sandboxing or containerization.
sudo chmod 750 /usr/local/bin/brandy
sudo setcap -r /usr/local/bin/brandy
Input validation wrapper
allCreate a wrapper script that validates BASIC program input before passing to the interpreter.
#!/bin/bash
# Validate input file before execution
if [ -f "$1" ]; then
# Add validation logic here
/usr/local/bin/brandy "$1"
fi
🧯 If You Can't Patch
- Isolate the interpreter in a dedicated virtual machine or container with no network access.
- Implement strict access controls so only trusted users can execute BASIC programs.
🔍 How to Verify
Check if Vulnerable:
Check the interpreter version: brandy --version or examine the binary file properties.
Check Version:
brandy --version
Verify Fix Applied:
Confirm the version is 1.22 or later and test with known exploit samples if available.
📡 Detection & Monitoring
Log Indicators:
- Unusual interpreter crashes
- Large or malformed BASIC program execution attempts
Network Indicators:
- Network traffic to/from the interpreter if it has network capabilities
SIEM Query:
process.name="brandy" AND (event.action="crash" OR process.args.size>1000000)