Join our Newsletter — 33% off our NHI Course

Malicious Commit

A malicious commit is a source control change that appears ordinary but contains hidden intent to harm, evade review, or enable compromise. Examples include obfuscated code, suspicious shell commands, encoded payloads, secret leakage, and edits that weaken build or deployment controls.

Expanded Definition

A malicious commit is more than a bad code change. In security terms, it is a deliberate source control action designed to look routine while introducing harmful behavior, weakening safeguards, or concealing evidence. That may include obfuscated logic, hidden command execution, secret extraction, or modifications that reduce logging, testing, or deployment integrity. Because the commit appears to belong to normal development work, it can bypass casual review and blend into a legitimate change set.

The concept sits at the intersection of secure software delivery, code review discipline, and identity governance. A commit may be malicious even when the author account is valid, especially if an insider, compromised developer identity, or abused automation token is involved. Definitions vary across vendors and tooling categories, but the core security concern is consistent: the source repository itself becomes a trust boundary that attackers try to subvert. Guidance from the NIST Cybersecurity Framework 2.0 reinforces the need to manage integrity and protect software workflows, not only endpoints and networks.

The most common misapplication is treating a malicious commit as merely a coding mistake, which occurs when reviewers focus on syntax or functionality but ignore intent, provenance, and control bypass signals.

Examples and Use Cases

Implementing review controls rigorously often introduces friction for developers, requiring organisations to balance delivery speed against stronger validation of source changes.

  • A commit adds a harmless-looking helper function but also executes a hidden shell command during build time, creating a path for payload delivery.
  • A change removes input validation or disables a security check, making later stages of the pipeline easier to compromise.
  • A contributor patches a file while also inserting a hardcoded API key, token, or certificate material that should never be in source control.
  • An attacker with access to a development account submits a clean-looking change that alters deployment scripts, dependencies, or CI rules to create persistence.
  • A review passes because the diff is small, yet the commit message, authoring pattern, or dependency change is inconsistent with normal engineering practice.

For teams that maintain mature software assurance programs, the term is often discussed alongside repository integrity controls, protected branches, and signed commits. The practical lesson is that OWASP guidance on software and AI-adjacent development risks is useful when code generation, automation, or agentic tooling contributes to repository changes. A malicious commit may also exploit human trust by using routine maintenance language to conceal a security-relevant action.

Why It Matters for Security Teams

Malicious commits matter because software repositories are high-trust control points: a single deceptive change can undermine application security, supply chain integrity, and downstream deployment confidence. Security teams need to understand the term as a governance problem, not just a code review problem. If commit provenance is weak, if privileged developer accounts are overexposed, or if CI/CD permissions are too broad, then the repository becomes a direct attack surface. This is especially relevant where non-human identities such as bots, build agents, and automation tokens can submit or approve changes, because those identities may be less visible than human users while still holding powerful access.

Strong controls include branch protections, mandatory peer review, signed commits, secret scanning, dependency checking, and alerting around unusual repository behavior. The NIST SP 800-53 control catalog is useful for mapping integrity, access, and monitoring expectations to software delivery workflows, while OWASP Non-Human Identities helps teams think about automation accounts that can create or influence commits. Organisations typically encounter the full impact only after a release has been tainted or a secret has already been exposed, at which point malicious commit analysis becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 PR.DS-6 Addresses integrity protections for software and data changes in delivery pipelines.
NIST SP 800-53 Rev 5 SI-7 System integrity controls map directly to detecting and limiting malicious code changes.
OWASP Non-Human Identity Top 10 Covers non-human identities that can author, approve, or automate commits.
OWASP Agentic AI Top 10 Agentic workflows can generate or submit code that must be governed before merge.
NIST AI RMF Supports governance of AI-assisted development where code changes may be machine-generated.

Inventory automation identities and restrict their ability to create or approve risky changes.