Code injection vulnerabilities occur when untrusted input is executed as code. This can happen through various means, such as system commands, eval functions, or database queries. If user input is not properly validated or sanitized, attackers can exploit this to execute arbitrary code on the server or client side. This can lead to severe consequences, including data breaches, system compromise, and denial of service.