Trustwave's 2024 Financial Services Threat Reports Highlight Alarming Trends in Insider Threats & Phishing-as-a-Service. Learn More

Trustwave's 2024 Financial Services Threat Reports Highlight Alarming Trends in Insider Threats & Phishing-as-a-Service. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

MySQL/MariaDB: Trade You a Banana for Root Access?

Summary

Over the weekend, an Authentication Bypass Vulnerability for MySQL and MariaDB (CVE-2012-2122) was released by Sergei Golubchik of Monty Program Ab (link). The vulnerability is trivial to exploit and has the potential to expose root user access to the database instance if the database service is exposed. As it happens, the binary packages provided by some popular Linux variants including Ubuntu, OpenSuSE, Fedora and others are affected by this issue.

In this post, we will cover exploiting the vulnerability as well as what you should do if you are running/evaluating vulnerable MySQL or MariaDB services.

Exploiting the MySQL Vulnerability

I spent some time this morning to confirm the vulnerability on a vanilla Ubuntu 12.04 LTS Linux 64-bit VM. I downloaded the latest Ubuntu 64-bit version, installed mysql-server using apt-get and here is what I came up with…

Successful MySQL Login (root/toor on localhost)
7913_0e7efeab-22a7-4dda-8bf4-0791ea4ffe47

Failed MySQL Login (root/bananas on localhost)
BSL_8436_28ece772-db8b-4e5e-af5c-65b22d002647

Successful MySQL Auth Bypass (root/bananas on localhost)
BSL_9092_49dfecc6-3e69-464d-8606-51834957de0f
BSL_11794_ca2e3447-4556-4a07-bded-ede5319f3316
Note:
The proof of concept above was based on info provided in Metasploit blog posted here earlier today.


What You Should Do?

Please note that at the time of this writing, the community is still in the process of identifying specific OS variants and their associated binary packages and compile options that are affected by this vulnerability. As a safety precaution, it is encouraged that all MySQL and MariaDB instances be tested for the existance of the vulnerability. Additionally, both vendors have addressed this vulnerability so it is highly recommended that the associated patches are applied as soon as possible and that access to the database service and users should be restricted by IP.

Additionally, for penetration testers and security assessors, you might want to jump on this now so you help your customers/clients confirm their exposure and/or mitigate this risk. The above example will work against remote instances by simply changing the value of the ip supplied to the "-h" (host) switch.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo