Code injection is the exploitation of a computer bug that allows an attacker to introduce malicious code into a computer program and alter its execution. There are several types of code injection including SQL injection, which modifies database values; OS command injection, which installs malware by exploiting vulnerabilities in browsers/plugins; and cross-site scripting (XSS), where malicious scripts are introduced into trusted websites. XSS can be stored, reflected, or DOM-based. Code injection attacks can have disastrous consequences, including compromising sensitive data, installing malware, and escalating privileges.