CVE-2020-35245

9.8 CRITICAL

📋 TL;DR

CVE-2020-35245 is a SQL injection vulnerability in FlamingoIM's UserManager::addUser function that allows attackers to execute arbitrary SQL commands. This affects all FlamingoIM deployments through version 2020-09-29. Attackers could potentially compromise the database and gain unauthorized access to sensitive information.

💻 Affected Systems

Products:
  • Flamingo (FlamingoIM)
Versions: All versions through 2020-09-29
Operating Systems: Any OS running FlamingoIM
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default configuration of the UserManager::addUser function.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Database information disclosure, user account manipulation, and potential privilege escalation within the application.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - If the vulnerable endpoint is exposed to the internet, attackers can directly exploit it without network access.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this vulnerability to escalate privileges.

🎯 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. Review and apply the fix from GitHub issue #47. 3. Restart the FlamingoIM service. 4. Verify the fix by testing the UserManager::addUser function.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement strict input validation for user parameters in the addUser function

Implement parameterized queries or prepared statements in the UserManager::addUser function

Database User Privilege Reduction

all

Reduce database user privileges to minimum required for application functionality

REVOKE unnecessary privileges from the FlamingoIM database user
GRANT only SELECT, INSERT, UPDATE on required tables

🧯 If You Can't Patch

  • Implement a web application firewall (WAF) with SQL injection rules
  • Disable or restrict access to the vulnerable UserManager::addUser endpoint

🔍 How to Verify

Check if Vulnerable:

Check FlamingoIM version - if it's 2020-09-29 or earlier, it's vulnerable. Test the UserManager::addUser endpoint with SQL injection payloads.

Check Version:

Check FlamingoIM version in application configuration or via package manager

Verify Fix Applied:

Test the UserManager::addUser function with SQL injection payloads after patching - should return errors or reject malicious input.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed addUser attempts with special characters
  • Database error messages containing SQL syntax

Network Indicators:

  • Unusual patterns in requests to UserManager endpoints
  • Requests containing SQL keywords like UNION, SELECT, INSERT

SIEM Query:

source="flamingo_logs" AND (message="*SQL*" OR message="*syntax*" OR message="*addUser*" AND (message="*' OR*" OR message="*UNION*"))

🔗 References

📤 Share & Export