CVE-2023-27558

8.4 HIGH

📋 TL;DR

This vulnerability allows local attackers to escalate privileges on IBM Db2 for Windows systems by exploiting unquoted service paths. Attackers can place malicious executables in service paths to execute code with higher privileges. Affects IBM Db2 versions 10.5, 11.1, and 11.5 on Windows systems.

💻 Affected Systems

Products:
  • IBM Db2
Versions: 10.5, 11.1, 11.5
Operating Systems: Windows
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Windows installations where Db2 services use unquoted paths. Linux/Unix systems are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise with SYSTEM/administrator privileges, enabling installation of persistent malware, data theft, and lateral movement.

🟠

Likely Case

Local privilege escalation allowing attackers to gain administrative control over the Db2 database server and potentially the host system.

🟢

If Mitigated

Limited impact with proper access controls, monitoring, and service hardening in place.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring local access to the system.
🏢 Internal Only: HIGH - Internal attackers or compromised accounts can exploit this to gain elevated privileges on Db2 servers.

🎯 Exploit Status

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

Exploitation requires local access to the system. Unquoted service path vulnerabilities are well-understood and easily exploitable by attackers with local access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Apply fixes from IBM security advisory

Vendor Advisory: https://www.ibm.com/support/pages/node/7010571

Restart Required: Yes

Instructions:

1. Review IBM advisory for specific patch versions. 2. Apply IBM-provided fixes for affected Db2 versions. 3. Restart affected Db2 services. 4. Verify service paths are properly quoted.

🔧 Temporary Workarounds

Quote Service Paths

windows

Manually add quotes around service executable paths in Windows Registry

sc config "ServiceName" binPath= ""C:\Program Files\IBM\SQLLIB\BIN\db2syscs.exe""
Restart the service after modification

Restrict Write Permissions

windows

Remove write permissions from directories in the service path

icacls "C:\Program Files" /deny "Users":(OI)(CI)W
icacls "C:\Program Files (x86)" /deny "Users":(OI)(CI)W

🧯 If You Can't Patch

  • Implement strict access controls to limit local user access to Db2 servers
  • Monitor for suspicious file creation in system directories and service execution

🔍 How to Verify

Check if Vulnerable:

Check Windows services for Db2-related services with unquoted paths using: sc qc "ServiceName" | findstr BINARY_PATH_NAME

Check Version:

db2level command or check Windows Registry: HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\InstalledCopies

Verify Fix Applied:

Verify service paths are quoted: sc qc "ServiceName" | findstr BINARY_PATH_NAME should show quoted paths

📡 Detection & Monitoring

Log Indicators:

  • Windows Event Logs: Service Control Manager events (7036, 7040) showing service path modifications
  • Security logs: Unauthorized file creation in system directories
  • Application logs: Unexpected service restarts or failures

Network Indicators:

  • N/A - Local privilege escalation only

SIEM Query:

EventID=4688 AND (NewProcessName="*\temp\*" OR NewProcessName="*\program files\*") AND ParentProcessName="services.exe"

🔗 References

📤 Share & Export