CVE-2023-31483

7.5 HIGH

📋 TL;DR

This vulnerability allows attackers to perform directory traversal attacks via crafted tar archives in Cauldron cbang's tar extraction functionality. Attackers can create or overwrite files outside the intended extraction directory, potentially leading to arbitrary file writes. This affects systems using cbang versions before bastet-v8.1.17.

💻 Affected Systems

Products:
  • Cauldron cbang
Versions: All versions before bastet-v8.1.17
Operating Systems: All platforms where cbang is installed
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in tar/TarFileReader.cpp during tar archive extraction operations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via arbitrary file writes leading to remote code execution, privilege escalation, or data destruction.

🟠

Likely Case

Unauthorized file creation/modification outside extraction directory, potentially leading to data corruption, privilege escalation, or denial of service.

🟢

If Mitigated

Limited impact with proper file permissions and sandboxing, potentially only affecting non-critical files.

🌐 Internet-Facing: MEDIUM - Exploitation requires tar archive upload/processing capability, which may be present in web applications or APIs.
🏢 Internal Only: MEDIUM - Internal users with tar processing capabilities could exploit this for privilege escalation or lateral movement.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to provide crafted tar archives to vulnerable extraction functionality.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: bastet-v8.1.17 and later

Vendor Advisory: https://github.com/CauldronDevelopmentLLC/cbang/compare/bastet-v8.1.16...bastet-v8.1.17

Restart Required: No

Instructions:

1. Update cbang to version bastet-v8.1.17 or later. 2. Rebuild any applications using cbang. 3. Replace existing installations with patched version.

🔧 Temporary Workarounds

Validate tar archive paths

all

Implement path validation before extraction to prevent directory traversal

Implement custom validation: if (path.contains("..") || path.startsWith("/")) { reject_archive(); }

Use extraction sandbox

linux

Extract archives in isolated directories with restricted permissions

mkdir -p /tmp/sandbox_$(date +%s) && chmod 700 /tmp/sandbox_*
cd /tmp/sandbox_* && tar -xf archive.tar

🧯 If You Can't Patch

  • Disable tar extraction functionality in cbang if not required
  • Implement strict input validation and sanitization for all tar archive processing

🔍 How to Verify

Check if Vulnerable:

Check cbang version: if version < bastet-v8.1.17, system is vulnerable

Check Version:

Check build configuration or application dependencies for cbang version

Verify Fix Applied:

Confirm cbang version is bastet-v8.1.17 or later and test tar extraction with crafted archives

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file creation/modification outside extraction directories
  • Failed tar extraction attempts with suspicious paths

Network Indicators:

  • Large or unusual tar archive uploads to applications

SIEM Query:

file_create OR file_modify WHERE path CONTAINS ".." AND process_name="cbang"

🔗 References

📤 Share & Export