CVE-2019-7653

9.8 CRITICAL

📋 TL;DR

This vulnerability allows local code injection in Debian's python-rdflib-tools package. Attackers can execute arbitrary Python code by placing malicious modules in the current working directory when CLI tools like rdf2dot are run. This affects Debian systems using the vulnerable package version.

💻 Affected Systems

Products:
  • Debian python-rdflib-tools
Versions: 4.2.2-1
Operating Systems: Debian Linux, Ubuntu (derived from affected Debian packages)
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems where python-rdflib-tools is installed and CLI tools from debian/scripts directory are used.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise via arbitrary code execution with the privileges of the user running the vulnerable CLI tool, potentially leading to privilege escalation.

🟠

Likely Case

Local privilege escalation or arbitrary code execution by malicious users with access to the system, particularly in multi-user environments.

🟢

If Mitigated

Limited impact if proper access controls restrict who can write to directories where CLI tools are executed.

🌐 Internet-Facing: LOW - This is primarily a local vulnerability requiring access to the system.
🏢 Internal Only: HIGH - Internal users with shell access can exploit this for privilege escalation or lateral movement.

🎯 Exploit Status

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

Exploitation requires local access and ability to place files in the current working directory where CLI tools are executed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.2.2-1+deb9u1 (Debian 9/stretch), 4.2.2-1+deb10u1 (Debian 10/buster)

Vendor Advisory: https://lists.debian.org/debian-lts-announce/2019/03/msg00019.html

Restart Required: No

Instructions:

1. Update package: sudo apt-get update && sudo apt-get install python-rdflib-tools
2. Verify version is patched: dpkg -l python-rdflib-tools

🔧 Temporary Workarounds

Remove vulnerable package

linux

Uninstall python-rdflib-tools if not needed

sudo apt-get remove python-rdflib-tools

Restrict directory permissions

linux

Ensure users cannot write to directories where CLI tools are executed

chmod 755 /path/to/execution/directory
chown root:root /path/to/execution/directory

🧯 If You Can't Patch

  • Remove python-rdflib-tools package entirely if not required
  • Implement strict access controls to prevent users from writing to directories where CLI tools might be executed

🔍 How to Verify

Check if Vulnerable:

Check installed version: dpkg -l python-rdflib-tools | grep ^ii

Check Version:

dpkg -l python-rdflib-tools | grep ^ii | awk '{print $3}'

Verify Fix Applied:

Verify version is 4.2.2-1+deb9u1 or later for Debian 9, or 4.2.2-1+deb10u1 or later for Debian 10

📡 Detection & Monitoring

Log Indicators:

  • Unusual Python module imports from current directory
  • Execution of rdf2dot or other python-rdflib-tools CLI tools with suspicious parameters

Network Indicators:

  • None - this is a local vulnerability

SIEM Query:

Process execution where command contains 'rdf2dot' or 'python -m' with unusual paths

🔗 References

📤 Share & Export