Structured query language (SQL) is a type of computer language used for database management and manipulation of data. It’s rare for modern computer users to see or make SQL queries directly—the process is largely abstracted in computer user interfaces today. Instead of manually making SQL queries on a command line prompt, most operating systems have a visual filing system interface that lets important files be sorted into folders on the computer’s storage drive.
So, what are SQL queries? Here’s a quick list of some different types of SQLs:
Why is knowing about SQL code and queries important if most users in your organization (apart from your IT guys) never really deal with them? One reason is because of the risk of SQL injection (SQLI) attacks. What is SQL injection? Here’s a quick explanation of how SQLI works and how to prevent SQL injection:
The basic definition of an SQL injection attack is that it’s a type of cyberattack that relies on injecting malicious SQL code to manipulate a target’s database to reveal potentially sensitive information. Depending on the attack type, this could be specific files or data on the target system/database or even information about the database’s structure.
SQL injection attacks come in several different categories, including:
What if I told you that, with a single line of SQL code, an attacker could potentially delete an entire database? A single bit of data manipulation language or data definition language could be used to delete crucial information. For example, a DROP TABLE command could be used to force a database to start deleting entire tables of data.
Alternatively, an SQLI attack could be used to obtain user names and passwords from a database—giving the attacker access to genuine user credentials that can be used for further attacks.
The damage and disruption different forms of SQL injection attacks can cause is catastrophic, and should not be underestimated. Just imagine how badly your organization’s operations would be affected if your databases were suddenly deleted or if malicious actors could freely access your payroll and/or invoice system.
There are a few ways to stop SQL injection attacks. One of the most basic strategies is to use input validation to identify illicit user inputs and selectively ignore them. However, while a good idea, it can be hard to write code that maps out every single possible variation of both legitimate and illegitimate command inputs. At the very least, you would run a risk of numerous false positives that would negatively impact user experience and system functionality.
The more reliable solution is to use a web application firewall (WAF) to filter out SQLI traffic (and other malicious traffic) from your network. One method that web application firewalls can use to filter traffic is signal recognition—comparing incoming traffic to whitelists of “safe” signals or blacklists of “unsafe” signals to block potentially malicious SQL code.
Some web application firewall solutions can cross reference IP address data with blacklists of IP addresses that have been previously identified as malicious as well.
It can help to proactively test your network to see if your databases and applications are vulnerable to different types of SQLI attacks. By finding these vulnerabilities early, you can increase your chances of being able to fix them before someone else can exploit them.
Need help determining if your organization is vulnerable to SQL injection? Reach out to the Compuquip team for help!