CVE-2019-1010191

9.8 CRITICAL

📋 TL;DR

CVE-2019-1010191 is a SQL injection vulnerability in Marginalia library versions before 1.6 that allows attackers to execute arbitrary SQL queries through user-controlled components like HTTP parameters or headers. This affects any application using vulnerable Marginalia versions where user input is passed to the library's components. The vulnerability enables complete database compromise.

💻 Affected Systems

Products:
  • marginalia
Versions: All versions < 1.6
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that pass user-controlled data to Marginalia components. The vulnerability is in the library itself, not dependent on specific application configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise including data theft, data manipulation, privilege escalation, and potential remote code execution through database functions.

🟠

Likely Case

Data exfiltration, authentication bypass, and unauthorized data modification in affected applications.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place, though the underlying vulnerability remains.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection vulnerabilities are commonly exploited and weaponized. The public pull request shows the exact vulnerable code pattern.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.6

Vendor Advisory: https://github.com/basecamp/marginalia/pull/73/

Restart Required: Yes

Instructions:

1. Update Marginalia gem to version 1.6 or higher. 2. Run 'bundle update marginalia' if using Bundler. 3. Restart your application server. 4. Verify the update with 'bundle show marginalia' or checking Gemfile.lock.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and sanitization for all user-controlled data before passing to Marginalia components.

Parameterized Queries

all

Ensure all database queries use parameterized statements instead of string concatenation with user input.

🧯 If You Can't Patch

  • Implement WAF rules to block SQL injection patterns in HTTP parameters and headers
  • Restrict database user permissions to minimum required privileges

🔍 How to Verify

Check if Vulnerable:

Check Gemfile.lock or run 'bundle show marginalia' to see installed version. If version is < 1.6, the system is vulnerable.

Check Version:

bundle show marginalia | grep -o 'marginalia.*'

Verify Fix Applied:

Confirm Marginalia version is 1.6 or higher using 'bundle show marginalia' or checking Gemfile.lock.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL query patterns in application logs
  • Multiple failed login attempts with SQL-like syntax in parameters
  • Database error messages containing user input

Network Indicators:

  • HTTP requests with SQL keywords in parameters or headers
  • Unusual database connection patterns from application servers

SIEM Query:

source="application.logs" AND ("SELECT" OR "UNION" OR "INSERT" OR "UPDATE" OR "DELETE") AND NOT expected_query_pattern

🔗 References

📤 Share & Export