By NHI Mgmt Group Editorial TeamBased on Cycode: “Malicious Code Detection: Tools and Guide” (December 4, 2025)

TL;DR: Malicious code detection has moved beyond signature checks into SAST, SCA, secrets scanning, CI/CD security, and runtime analysis because supply-chain attacks are rising, exploit windows are shrinking, and AI-generated code is expanding the attack surface, according to Cycode. The practical lesson is that security teams need detection and governance across the full software lifecycle, not only at the endpoint.


At a glance

What this is: Cycode argues that malicious code detection has moved beyond signature checks to coverage across code, dependencies, pipelines and runtime.

Why it matters: This matters because AppSec and platform teams cannot govern malicious code with endpoint-style detection alone when the attack surface now follows the SDLC.

By the numbers:

  • Supply chain attacks increased by 200% in 2024, according to Cycode.

Context

Malicious code is no longer confined to obvious malware on endpoints. In modern software delivery, harmful code can enter through source repositories, third-party dependencies, CI/CD runners, containers, infrastructure-as-code, and runtime behaviour, which means detection has to be tied to the delivery lifecycle rather than a single control point.

The governance gap is that many teams still separate application security, pipeline security and runtime monitoring into different workflows. That separation creates blind spots for code that is introduced legitimately into the build process but becomes malicious only when it is executed, deployed or chained with other components.


Key questions

Q: What breaks when malicious code is only detected at one stage of the SDLC?

A: Single-stage detection leaves the rest of the software factory blind. A package can pass one scan, move through a trusted pipeline, and still behave maliciously only when deployed or executed. The result is false confidence, delayed containment and wider downstream propagation before defenders see the payload in context.

Q: Why do CI/CD pipelines create special risk for malicious code propagation?

A: CI/CD pipelines concentrate trust, credentials and automation in one place. If a malicious dependency or injected snippet reaches the runner, it can inherit build permissions, produce signed artefacts and push compromise into multiple downstream environments. The risk is not just code execution, but trusted distribution at scale.

Q: How can security teams tell whether malicious code controls are actually working?

A: They should look for whether findings are caught before release, whether runtime alerts confirm or refute static findings, and whether high-risk changes are stopped by policy rather than manual exception. If malware and supply-chain threats still reach production, the control set is too narrow or too late in the lifecycle.

Q: Should organisations prioritise pipeline security or runtime detection first?

A: They should do both, but pipeline security usually deserves the earlier investment because it blocks malicious artefacts before they spread. Runtime detection remains essential because static review cannot prove behaviour in production. The right sequence is to stop obvious trust-path abuse, then add behavioural confirmation where execution risk remains.


Technical breakdown

Why malicious code now requires lifecycle-wide detection

Malicious code detection used to focus on files and signatures, but modern delivery systems blur the line between code, build artefacts and runtime behaviour. A package can look legitimate at commit time, pass through a trusted pipeline, and only reveal hostile behaviour when it reaches a container, a production job or an AI-generated dependency chain. That is why static analysis, software composition analysis, secrets scanning and runtime analysis now have to work together. Each one sees a different stage of the same risk. The central problem is provenance and context, not only code content.

Practical implication: treat detection as a lifecycle control that must follow code from commit through production, not as a single pre-merge gate.

How CI/CD pipelines become part of the attack path

CI/CD systems are not just delivery machinery. They are executable trust zones that can consume secrets, pull dependencies, build artefacts and deploy production code. When malicious code or compromised dependencies enter the pipeline, they can reach many downstream environments before defenders notice. This is especially dangerous where runners, service accounts or build credentials have broad access. The operational issue is that the pipeline often inherits trust automatically, while the artefacts it produces are not continuously re-validated after build time. That makes the pipeline a control surface, not just a transport layer.

Practical implication: enforce policy and credential controls inside the pipeline, not only around it, and validate build outputs again before deployment.

Why runtime analysis matters when code and AI output are mutable

Runtime analysis catches behaviour that static inspection cannot prove in advance. That includes suspicious network connections, privilege abuse, unexpected process spawning, and logic that only becomes dangerous in a live environment. It also matters for AI-generated code, where volume and variation make purely manual review unrealistic. In practice, runtime signals help separate theoretical risk from active exploitation, especially when an attacker hides payloads inside otherwise normal code paths. The challenge is to correlate code-level findings with what the workload actually does after release.

Practical implication: pair code scanning with behavioural monitoring so that malicious intent can be detected after deployment as well as before it.


Threat narrative

Attacker objective: The attacker’s objective is to turn trusted software delivery into a distribution channel for persistence, theft, sabotage or downstream compromise.

  1. Entry occurs through malicious or compromised code introduced into source repositories, third-party dependencies or CI/CD pipelines.
  2. Credentialed pipeline access or trusted build mechanics allow the malicious code to move into compiled artefacts and downstream environments.
  3. Execution in runtime exposes the hostile behaviour, including theft, backdoors, ransomware payloads or broader supply-chain propagation.
  4. Impact is achieved when downstream applications, users or services inherit the compromised artefact at scale.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Lifecycle detection is now the only defensible model for malicious code governance. The article’s core lesson is that code security, pipeline security and runtime security are no longer separable disciplines. Once malicious logic can enter through dependencies or AI-generated snippets, point-in-time scanning misses the control failure. Practitioners should treat the SDLC as a single trust chain, not three disconnected tool categories.

CI/CD runners are becoming identity-bearing attack surfaces. When build systems can fetch secrets, sign artefacts and deploy code, the runner itself functions like a machine identity with privileged access scope. That makes the intersection with NHI governance real, not theoretical. If those build identities are not inventoried, constrained and revoked on lifecycle events, the pipeline becomes a persistence layer for malicious code.

Runtime evidence should drive final trust decisions, not just code review outcomes. Static checks remain necessary, but they cannot determine how a payload behaves once it inherits production context, credentials or network reach. That pushes security teams toward continuous verification and away from one-time approval models. The practical conclusion is that exploitability is an operational condition, not a pre-deploy assumption.

Pipeline trust gap: build systems often inherit access before they have been independently authenticated as safe. That is the governance failure malicious code exploits in modern software factories. The issue is not simply weak scanning, but the assumption that a trusted runner or dependency stays trustworthy across every stage of delivery. Practitioners should design controls around that trust boundary, not around the code object alone.

AI-generated code expands the review problem faster than manual governance can absorb it. Large-scale code generation increases volume, reuse and pattern ambiguity, which means security teams need machine-assisted detection and stronger policy enforcement. The relevant question is no longer whether AI code exists, but whether governance can distinguish benign acceleration from embedded malicious behaviour. Teams should align AI coding policies with the same control standard as third-party code.

From our research library:

What this signals

Pipeline trust gap: malicious code governance now depends on closing the boundary between trusted build systems and trusted release artefacts. Security teams should assume that a build runner with broad access behaves like a machine identity and govern it accordingly, including inventory, scope reduction and lifecycle offboarding.

The operational shift is toward control correlation. Static code review, dependency analysis, secret scanning and runtime telemetry only become reliable when teams connect them to one policy model and one incident path, rather than leaving each signal in a separate tool chain.


For practitioners

  • Establish end-to-end malicious code coverage Map coverage across source code, dependencies, CI/CD pipelines, containers and runtime so each stage has a defined control owner and detection method.
  • Treat build runners as privileged identities Inventory runner accounts, service credentials and signing privileges, then scope them to the minimum artefact, repository and deployment access required.
  • Gate merges on policy, not only findings Use pull request checks, secret scanning and dependency controls as merge conditions for high-risk changes, with exceptions routed through explicit approval.
  • Correlate runtime telemetry with code findings Feed behavioural signals such as unusual process launches, network calls and privilege use back into AppSec triage so post-build execution informs trust decisions.
  • Assume AI-generated code needs the same scrutiny as third-party code Apply the same review, scanning and release controls to AI-assisted code paths that you use for external packages and manually authored libraries.

Key takeaways

  • Malicious code detection has become a lifecycle governance problem, not a single-tool scanning problem, because code, dependencies, pipelines and runtime now all carry trust.
  • Trusted build infrastructure can amplify malicious code into a supply-chain event, especially when runner identities and artefact permissions are broad or poorly governed.
  • The most effective control model combines pre-merge prevention, build-time policy enforcement and runtime behavioural confirmation so that one blind spot does not become the breach path.

Standards & Framework Alignment

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

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

FrameworkControl / ReferenceRelevance
MITRE ATT&CKTA0006; TA0008; TA0010 — Credential Access; Lateral Movement; ExfiltrationThe article describes malicious code moving through trusted software paths and enabling downstream compromise.
Recommendation — Map malicious code paths to TA0006, TA0008 and TA0010 to prioritise detection across build and runtime stages.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article repeatedly ties malicious code risk to compromised secrets, pipelines and dependency abuse.
NHI-05 — Overprivileged NHIBuild runners and pipeline identities are described as high-trust execution points with broad access.
Recommendation — Scan pipelines and build artefacts for exposed secrets and revoke any credential that appears in malicious code paths. Reduce runner and service account scope so CI/CD identities cannot move malicious artefacts beyond their intended boundary.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementMalicious code often weaponises long-lived pipeline credentials and token access.
Recommendation — Apply IA-5 to rotate and revoke pipeline credentials before they can be reused to spread malicious code.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article centres on controlling who and what can move through the software factory.
Recommendation — Review entitlements on runners, build services and deployment paths so malicious artefacts cannot inherit excessive access.

Key terms

  • Malicious Code: Code deliberately written to perform unauthorized or harmful actions inside software, scripts, dependencies, or build assets. It is narrower than malware because it focuses on the code layer that gets embedded into applications and delivery pipelines, where it can steal data, open backdoors, or alter system behavior.
  • Software Supply Chain: A software supply chain is the set of tools, identities, dependencies, and processes that turn source code into deployed software. Because it relies on automation and privileged machine identities, it becomes a governance problem when access, signing, and deployment controls are too broad.
  • CI/CD Pipeline: The automated systems that build, test, and deploy software, often holding privileged credentials for source control, cloud access, and release automation. When these pipelines leak secrets, they can turn a software delivery function into a high-trust compromise path.
  • Runtime Analysis: Runtime analysis is the inspection of software while it is executing, not just by reading code or documentation. It reveals actual network behaviour, decrypted payloads, and privilege use, which is essential when embedded SDKs hide collection logic behind obfuscation or client-side encryption.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security and secrets management. It helps identity and security practitioners connect lifecycle control to the wider access and trust model their programmes depend on.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 20, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org