CVE-2024-42166

9.1 CRITICAL

📋 TL;DR

This vulnerability allows authenticated users with application creation permissions to execute arbitrary operating system commands by creating applications with malicious names in FIWARE Keyrock. The OS command injection occurs because the 'generate_app_certificates' function doesn't properly sanitize input. Systems running FIWARE Keyrock version 8.4 or earlier are affected.

💻 Affected Systems

Products:
  • FIWARE Keyrock
Versions: <= 8.4
Operating Systems: All operating systems where FIWARE Keyrock is installed
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user with permissions to create applications. Default installations grant these permissions to certain roles.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise allowing attackers to execute arbitrary commands with the privileges of the FIWARE Keyrock process, potentially leading to data theft, system takeover, or lateral movement within the network.

🟠

Likely Case

Authenticated attackers with application creation privileges can execute commands to exfiltrate sensitive data, create backdoors, or disrupt services.

🟢

If Mitigated

Limited impact if proper input validation and command sanitization are implemented, restricting attackers to the application's sandboxed environment.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

Exploitation requires authenticated access with application creation privileges. The vulnerability is straightforward to exploit once authenticated.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: > 8.4

Vendor Advisory: https://www.ait.ac.at/themen/cyber-security/pentesting/security-advisories

Restart Required: Yes

Instructions:

1. Upgrade FIWARE Keyrock to version 8.5 or later. 2. Restart the FIWARE Keyrock service. 3. Verify the fix by checking the version and testing application creation with special characters.

🔧 Temporary Workarounds

Restrict Application Creation Permissions

all

Temporarily remove or restrict permissions for users to create applications until patching is complete.

Input Validation Filter

all

Implement a web application firewall or input validation filter to block special characters in application names.

🧯 If You Can't Patch

  • Implement strict least-privilege access controls to limit who can create applications.
  • Monitor and audit application creation logs for suspicious activity and unusual application names.

🔍 How to Verify

Check if Vulnerable:

Check the FIWARE Keyrock version. If it's 8.4 or earlier, the system is vulnerable. Review user permissions to see who can create applications.

Check Version:

Check the package version or application configuration files for the FIWARE Keyrock version number.

Verify Fix Applied:

After upgrading to version 8.5 or later, attempt to create an application with special characters in the name. The system should reject or sanitize the input without executing commands.

📡 Detection & Monitoring

Log Indicators:

  • Unusual application creation events with special characters in names
  • Unexpected command execution logs from the FIWARE Keyrock process

Network Indicators:

  • Suspicious outbound connections from the FIWARE Keyrock server

SIEM Query:

Search for application creation events in FIWARE Keyrock logs containing special characters like ;, |, &, $, or backticks.

🔗 References

📤 Share & Export