CVE-2023-46400

9.8 CRITICAL

📋 TL;DR

KWHotel 0.47 contains a CSV formula injection vulnerability in the add guest function that allows attackers to inject malicious formulas into exported CSV files. When victims open these files in spreadsheet applications like Excel, the formulas can execute commands, potentially leading to remote code execution. This affects all users of KWHotel 0.47 who export guest data.

💻 Affected Systems

Products:
  • KWHotel
Versions: 0.47
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the guest management functionality where user input is not properly sanitized before being included in CSV exports.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution on victim's machine when they open a malicious CSV file in Excel, potentially leading to full system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Data exfiltration, phishing attacks, or malware delivery through malicious formulas that execute when users open CSV files in spreadsheet applications.

🟢

If Mitigated

Limited impact if users open CSV files in text editors instead of spreadsheet applications, or if proper input validation is implemented.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires authenticated access to the add guest function. The vulnerability is simple to exploit once authenticated.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available, or implement workarounds.

🔧 Temporary Workarounds

Input Sanitization

all

Implement server-side validation to sanitize user input by escaping special characters like =, +, -, @ before including in CSV exports.

CSV Export Filtering

all

Modify CSV export functionality to prepend a single quote (') to fields starting with formula characters, or use tab-separated values instead.

🧯 If You Can't Patch

  • Restrict access to the guest management functionality to trusted users only
  • Educate users to open CSV files in text editors rather than spreadsheet applications
  • Implement network segmentation to limit the impact of potential exploitation

🔍 How to Verify

Check if Vulnerable:

Test by adding a guest with a formula payload like =cmd|' /C calc'!A0 in the name field, then export to CSV and open in Excel to see if formula executes.

Check Version:

Check KWHotel version in application interface or configuration files

Verify Fix Applied:

After implementing fixes, test with the same payload to ensure formulas are properly escaped and do not execute when opening CSV files.

📡 Detection & Monitoring

Log Indicators:

  • Unusual guest entries containing formula characters (=, +, -, @) in guest management logs
  • Multiple CSV export requests from single user in short time

Network Indicators:

  • Unusual outbound connections from systems that opened CSV files exported from KWHotel

SIEM Query:

source="kwhotel_logs" AND (guest_name="=*" OR guest_name="+*" OR guest_name="-*" OR guest_name="@*")

🔗 References

📤 Share & Export