Logic Bomb

A logic bomb is malicious code hidden inside a legitimate program or system that stays dormant until a set condition is met, such as a date or an employee's account being deleted, and then deletes data or disrupts systems.

IntermediateCategory: Malware

Also called: time bomb, slag code

What is a logic bomb?

NIST defines a logic bomb as a piece of code intentionally inserted into a software system that will set off a malicious function when specified conditions are met. Until then, it does nothing, so it can sit unnoticed for months. A logic bomb set to go off on a particular date is sometimes called a time bomb.

How does a logic bomb work?

The code is planted in a script, application or scheduled task and checks for its trigger: a date, a particular file being opened, or a condition such as "if my user account no longer exists". When the trigger is met, it runs its payload, which is usually deleting data, corrupting databases or shutting down systems.

Who plants logic bombs?

Logic bombs are mostly an insider threat. Because they have to be planted inside systems, they're typically written by someone with legitimate access, such as a disgruntled administrator or developer, sometimes set to go off after they leave the company. CISA's insider threat guidance covers how organizations can reduce this risk.

How to protect your business

  • Apply least privilege and manage admin accounts with privileged access management.
  • Require code review and change approval for production scripts and scheduled tasks.
  • Review scheduled jobs and scripts when a technical employee or contractor leaves, and remove their access promptly.
  • Keep backups that admins can't delete on their own.

Related terms

Sources

  1. Glossary: logic bomb (NIST)
  2. Insider Threat Mitigation (CISA)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.