# Threats to unsecured databases

A threat is potential damage caused by an attacker using a technique to exploit a vulnerability. We have already seen examples of Derby vulnerabilities. Examples of damages, attackers, and techniques follow.

Significant damages include the following.

- Denial-of-service attacks: An attacker can monopolize resources on the host machine. For instance, an attacker can launch a runaway procedure on the Derby virtual machine, fill up the file system, or pepper the Derby server with incessant connection requests.
- Theft: An attacker can read private information stored in a Derby database or transmitted across the network. With enough privileges and by exploiting application code visible on the classpath, an attacker can use Derby to read private information stored elsewhere on the server machine or even on other machines inside the firewall.
- Corruption: An attacker can modify or destroy information stored in a Derby database or elsewhere inside the firewall.

Attackers include the following.

- Insiders: These are privileged persons who enjoy access to systems inside the firewall and maybe even to restricted machine rooms. Drunken System Administrators and disgruntled co-workers can cause significant damage.
- Outsiders: These include politically motivated governments and guerillas, commercially motivated businesses and criminals, and thrill-seeking attackers.

Techniques of attack include the following.

- SQL injection: This technique plagues applications that construct queries by concatenating input from clients. A clever client can put SQL into these fields. That SQL, not intended by the application, then runs inside the database.
- Man-in-the-middle: In this technique, the client believes that it is talking to the server. In reality, the connection has been intercepted by another machine. The device in the middle can examine and alter the traffic.
- Eavesdropping: This is a special case of the man-in-the-middle attack. The attacker listens to the network traffic but does not interfere with it. An example of this technique is password sniffing, in which a machine in the middle intercepts the credentials handshake between client and server.
- Malware: This is a general term for viruses, worms, trojan horses, and other intrusive or destructive code that can infect a machine.
- Probing: This is the technical equivalent of jiggling door handles to see what doors are unlocked.
- Physical access: This refers to the low-tech, brute-force technique of gaining physical access to a restricted area or machine and, for instance, exploiting superuser powers that might be available from a system's console.
- Social engineering: This refers to the low-tech technique of gaining and abusing the confidence of someone who has the keys.

Parent topic: Why databases need security
Related concepts
Vulnerabilities of unsecured databases