Early this week, Yahoo joined the ranks of many other large organizations that were successfully and publically breached this summer. The group claiming responsibility, known as ‘D33Ds Company, claims the breach was intended as a wakeup call to Yahoo’s security team and not as a malicious act. The breach involved the extraction of sensitive information such as the usernames and passwords or nearly half a million users, as well as the full database architecture of the web application. D33Ds Company was able to steal the information by exploiting a SQL injection vulnerability in an undisclosed Yahoo! web application that some have speculated is related to the company’s VOIP phone service.
To understand how to prevent becoming a victim of this type of attack, it’s important to how SQL Injection works and the different types of attacks. Most modern web applications such as the one breached by D33Ds Company involve two major components to operate. The first is the logic required to operate the application, the second is the database used to store persistent information like user credentials. When a user submits data such as their username and password into a website, the logic portion of the application makes a request to the database to validate the credentials provided by the user (does the username exist, and is the password correct?).
A SQL injection attack is designed to exploit insufficient controls over the types of requests a user can submit, which allows an attacker to request information from the database that it isn’t intended to provide. For instance, asking the database if a user’s password starts with the letter ‘a’, if not, how about ‘b’ etc. In the Yahoo example, attackers identified this type of vulnerability and leveraged it to extract every byte of information from the database.
However, not all SQL Injection attacks are equal. Some can be more destructive than others. The specific flavor of SQL injection used in the Yahoo attack, known as Union Based, is arguably the most destructive. This attack enables the attacker to extract extremely large chunks of data in a very short amount of time. It’s the difference between requesting each password one at a time (normal SQL injection), letter by letter (Blind SQL injection) or requesting hundreds of passwords in one shot (Union Based). Union Based attacks also make identifying the attack far more difficult because many preventative measures rely on the large volume of requests and time required to extract sensitive information as a way to identify and stop an attack in progress. Union attacks are very quick and require very few requests, making it more difficult to detect abnormal activity.
While SQL injection attacks are becoming fairly common, preventing them is not necessarily an easy endeavor. The preferred method is for companies to perform extensive reviews of the code which interacts with the database. These reviews help identify cases where an SQL injection attack may be successful, and once identified, the company can update the code to prevent an attack. This is not always possible, as the code may have been written by developers from other companies, ex-employees, or the code may not be available for review or modification at all. Aside from that, reviewing code is time consuming, requires skilled eyes, and is a point-in-time solution which must be repeated after every product update. For these reasons, many companies simply can’t accommodate the level of review necessary to avoid a breach. With that in mind, companies who are concerned about the possibility of a breach (which should be everyone!), must seek alternate solutions.
Mykonos Web Security for example, is a drop in minimal configuration solution that is designed to help address this problem. When an attacker targets a website, there is an extensive amount of work that must be done before a breach can be successful. This work involves probing and reverse engineering the web application and attempting to identify specific conditions the original developers had never anticipated. This is the type of activity that Mykonos looks for and stops. Once a malicious user is identified, they can be effectively stopped long before any valid exploits are discovered. Other solutions are available, but primarily focus on detection and less on real-time prevention. Web application firewalls for example, are effective at stopping known and automated SQL injection attacks, but are not difficult for skilled attackers, such as D33Ds Company, to bypass. You can see a demo of Mykonos here.
In addition to external protective measures like Mykonos, companies should also consider implementing tighter restrictions on their database, ensuring that users only have rights to access and manipulate data necessary to do their jobs. Giving the web application full unrestricted access to all database data and features is a common mistake in many web applications, which dramatically compounds the damage caused by a successful SQL injection attack. Companies should also consider other protections, such as encrypting sensitive information like passwords, or even storing that information in a secondary database with highly restrictive policies.
From a consumer’s perspective, the Yahoo and other similar breaches could have significant security consequences and they should take action. For one, several people re-use the same password on multiple website, which allows people to compromise multiple accounts at once. As a best practice, people should use different passwords and change them regularly to avoid being a victim.
However, ultimately the responsibility to prevent these types of attacks rests squarely on companies that need to protect the information their customers trust with them.
Discussing a wide range of topics impacting enterprises and data center security.