Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› Common Intermediate Language
Architecture & Implementation

Common Intermediate Language

← Back to Glossary
By NHI Mgmt Group Updated November 9, 2026 Domain: Architecture & Implementation

Common Intermediate Language is the intermediate bytecode used by the .NET runtime. Source languages compile to this instruction set, which the runtime then just-in-time compiles or interprets at execution time, allowing multiple languages to share the same execution environment and type system.

What Common Intermediate Language Does in the .NET Runtime

Common Intermediate Language, or CIL, is the shared instruction layer that sits between source code and the .NET runtime. It is not just a compiler output format, it is the portability and interoperability layer that lets different .NET languages target the same execution model, type system, and runtime services.

That design matters because the runtime, rather than the source language alone, becomes the enforcement point for type safety, metadata, and execution behaviour. In practice, CIL is one of the reasons .NET can support multiple languages without each language needing its own separate virtual machine.

How CIL Fits Into Compilation and Execution

Source code in languages such as C#, F#, or VB.NET is compiled into CIL plus metadata. At runtime, the Common Language Runtime can JIT-compile that intermediate code into native machine instructions, or in some execution paths interpret or transform it. The result is a consistent execution pipeline even when the original source language differs.

This split between compile time and runtime gives developers flexibility, but it also means the intermediate representation is meaningful on its own. CIL carries method bodies, control flow, type references, and assembly relationships that the runtime must trust and validate before execution. A good mental model is that CIL behaves more like a portable executable form than a simple source-language artifact.

Why CIL Matters for Security and Reliability

CIL is security-relevant because any weakness in how the runtime validates or loads it can affect every language built on .NET. If an application loads untrusted assemblies, depends on reflection-heavy code, or uses dynamic code generation, the security posture depends on the integrity of the intermediate code and the runtime's enforcement of type and access rules. The same portability that makes CIL useful can also widen the blast radius of a bad library or compromised package.

CIL also shapes reliability and compatibility. Because multiple languages converge on the same runtime representation, bugs in metadata, verification, or assembly binding can become cross-language failures rather than isolated language-specific issues. For practitioners, this is one reason dependency hygiene, signed packages, and controlled loading behaviour matter even when the application source looks safe.

Common Uses and What Distinguishes CIL From Source Code

CIL is often confused with high-level source code, but it is closer to a normalized execution form. It preserves language-neutral structure so that one language can call another, share libraries, and rely on the same runtime services. That makes it foundational to interoperability inside the .NET ecosystem.

It is also distinct from native machine code. Native code is specific to one CPU architecture, while CIL is designed to be platform-neutral until the runtime produces machine-specific instructions. That distinction is what allows a single compiled assembly to travel further across environments than a traditional ahead-of-time native binary.

Risk and Threat Considerations

CIL can become an attack surface when an organisation loads assemblies from external sources, accepts plugins, or runs code that can generate or modify intermediate instructions at runtime. The core risk is not the bytecode format itself, but the trust placed in code that the runtime will execute after loading and verification.

Failure mechanism: Compromised or malicious assemblies, unsafe deserialization paths, or overly permissive dynamic loading can introduce untrusted CIL into the execution path and let attacker-controlled code run inside the application's trust boundary.

Impact: That can lead to remote code execution, persistence through malicious libraries, tampering with business logic, and broad compromise of the application environment if the runtime executes code with elevated privileges or access to sensitive data.

Standards & Framework Alignment

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

NIST SP 800-53 Rev 5, CIS Controls v8, OWASP ASVS and SLSA set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SI-7 — Software, Firmware, and Information IntegrityCIL execution depends on trusted code integrity before runtime loads it.
CM-5 — Access Restrictions for ChangeCIL-based loading and modification paths are change points that must be controlled.
Recommendation — Verify .NET assemblies and intermediate code before execution to block tampered code. Restrict who can alter assemblies, plugins, and runtime-loading paths.
CIS Controls v8CIS-2 — Inventory and Control of Software AssetsCIL-bearing assemblies are software assets that need inventory and governance.
Recommendation — Inventory .NET assemblies and approved runtime packages to reduce shadow code risk.
OWASP ASVSV15 — Secure Coding and ArchitectureCIL is part of the .NET execution model that secure architecture choices must account for.
Recommendation — Design .NET applications to limit dynamic loading and untrusted code paths.
SLSASupply-chain Levels for Software ArtifactsCIL arrives through build artifacts whose provenance and integrity must be assured.
Recommendation — Apply artifact provenance controls to ensure delivered assemblies are built and verified securely.

Practitioner Guidance

What to watch for: Treat CIL as part of the supply chain for .NET applications, not just an implementation detail. Review where assemblies come from, how plugins are loaded, whether runtime code generation is actually needed, and whether code signing, package validation, and load restrictions are enforced.

Practitioner takeaway: The safest .NET designs minimise unnecessary dynamic loading and keep the trust boundary around compiled assemblies as small and auditable as possible.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 9, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org