CVE-2021-30184

7.8 HIGH

📋 TL;DR

CVE-2021-30184 is a buffer overflow vulnerability in GNU Chess 6.2.7 that allows attackers to execute arbitrary code by providing malicious PGN (Portable Game Notation) data. This affects users who process untrusted PGN files with vulnerable versions of GNU Chess, potentially leading to complete system compromise.

💻 Affected Systems

Products:
  • GNU Chess
Versions: 6.2.7 specifically (and potentially earlier versions with same code)
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when processing PGN files via cmd_pgnload or cmd_pgnreplay functions

📦 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 pivot to other systems.

🟠

Likely Case

Local privilege escalation or denial of service when processing malicious PGN files from untrusted sources.

🟢

If Mitigated

Limited impact if systems don't process untrusted PGN files or have proper input validation in place.

🌐 Internet-Facing: LOW (GNU Chess is typically not exposed to internet-facing services)
🏢 Internal Only: MEDIUM (Risk exists if processing untrusted PGN files internally)

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting malicious PGN files and getting them processed by vulnerable GNU Chess instances

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.2.8 or later

Vendor Advisory: https://lists.gnu.org/archive/html/bug-gnu-chess/2021-04/msg00000.html

Restart Required: No

Instructions:

1. Update GNU Chess to version 6.2.8 or later using your distribution's package manager. 2. For Fedora/RHEL: 'sudo dnf update gnushogi'. 3. For Debian/Ubuntu: 'sudo apt update && sudo apt upgrade gnushogi'. 4. Verify installation with 'gnushogi --version'.

🔧 Temporary Workarounds

Restrict PGN file processing

all

Avoid processing untrusted PGN files with GNU Chess

Remove vulnerable version

linux

Uninstall GNU Chess 6.2.7 if not needed

sudo apt remove gnushogi
sudo dnf remove gnushogi
sudo yum remove gnushogi

🧯 If You Can't Patch

  • Implement strict input validation for PGN files before processing
  • Run GNU Chess in sandboxed/containerized environments with limited privileges

🔍 How to Verify

Check if Vulnerable:

Check GNU Chess version: 'gnushogi --version' or 'rpm -q gnushogi' or 'dpkg -l | grep gnushogi'

Check Version:

gnushogi --version

Verify Fix Applied:

Confirm version is 6.2.8 or later: 'gnushogi --version' should show 6.2.8+

📡 Detection & Monitoring

Log Indicators:

  • Segmentation faults or abnormal termination of GNU Chess processes
  • Unexpected file operations in /tmp directory

Network Indicators:

  • Unusual outbound connections from GNU Chess processes

SIEM Query:

process_name:"gnushogi" AND (event_type:"segfault" OR exit_code:139)

🔗 References

📤 Share & Export