CVE-2020-27372

9.8 CRITICAL

📋 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

Products:
  • Brandy Basic V Interpreter
Versions: Version 1.21
Operating Systems: Linux, Windows, RISC OS
Default Config Vulnerable: ⚠️ Yes
Notes: All installations of version 1.21 are vulnerable. The vulnerability is in the core interpreter function.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: MEDIUM - Risk depends on whether the interpreter processes untrusted input from network sources.
🏢 Internal Only: MEDIUM - Internal users could exploit the vulnerability if they can execute malicious BASIC programs.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

linux

Run 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

all

Create 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)

🔗 References

📤 Share & Export