CVE-2020-35243

9.8 CRITICAL

📋 TL;DR

CVE-2020-35243 is a SQL injection vulnerability in FlamingoIM's UserManager::updateUserInfoInDb function that allows attackers to execute arbitrary SQL commands. This affects all FlamingoIM installations through version 2020-09-29. Attackers could potentially access, modify, or delete database contents.

💻 Affected Systems

Products:
  • Flamingo (FlamingoIM)
Versions: All versions through 2020-09-29
Operating Systems: All platforms running FlamingoIM
Default Config Vulnerable: ⚠️ Yes
Notes: Any FlamingoIM installation using the vulnerable UserManager::updateUserInfoInDb function is affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, data destruction, authentication bypass, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized data access and modification, potentially exposing user credentials, messages, and sensitive information.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permission restrictions in place.

🌐 Internet-Facing: HIGH - FlamingoIM is typically deployed as a messaging server accessible over networks, making internet-facing instances particularly vulnerable.
🏢 Internal Only: HIGH - Even internal deployments are vulnerable to insider threats or compromised internal systems.

🎯 Exploit Status

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

SQL injection vulnerabilities are well-understood and easily weaponized. The GitHub issue shows proof of concept exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after 2020-09-29

Vendor Advisory: https://github.com/balloonwj/flamingo/issues/47

Restart Required: Yes

Instructions:

1. Update FlamingoIM to version after 2020-09-29. 2. Replace vulnerable UserManager::updateUserInfoInDb function with parameterized queries. 3. Restart FlamingoIM service.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement strict input validation for all user inputs to the updateUserInfoInDb function

# Add input validation in source code before SQL execution
# Example: if (!isValidInput(userInput)) { return error; }

Database Permission Reduction

all

Limit database user permissions to minimum required operations

# MySQL example: REVOKE ALL PRIVILEGES ON flamingo.* FROM 'flamingo_user'@'localhost';
# GRANT SELECT, INSERT, UPDATE ON flamingo.* TO 'flamingo_user'@'localhost';

🧯 If You Can't Patch

  • Implement web application firewall (WAF) with SQL injection rules
  • Isolate FlamingoIM server from sensitive networks and implement strict network access controls

🔍 How to Verify

Check if Vulnerable:

Check FlamingoIM version and verify if using UserManager::updateUserInfoInDb function without parameterized queries

Check Version:

# Check FlamingoIM version in configuration or about dialog

Verify Fix Applied:

Verify FlamingoIM version is after 2020-09-29 and inspect source code for parameterized queries in UserManager::updateUserInfoInDb

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL query patterns in database logs
  • Multiple failed login attempts followed by SQL errors
  • Unexpected database schema changes

Network Indicators:

  • Unusual SQL syntax in HTTP POST parameters
  • Multiple rapid requests to user update endpoints
  • Database connection attempts from unexpected sources

SIEM Query:

source="flamingo.log" AND ("SQL" OR "database" OR "query") AND ("error" OR "exception" OR "injection")

🔗 References

📤 Share & Export