A logic bomb is a malicious code fragment or script that is used to cause a program to malfunction or crash. Logic bombs are often used to exploit software vulnerabilities, but can also be used to destroy data or cause other types of damage.