What is untrusted code?

Untrusted code is code that you did not write or review. It can come from an AI model, a user or a third-party package. It can read secrets, call the network and use the machine's resources.

Updated

Where untrusted code comes from

An AI model writes code from a prompt. A user can send code to a service. The GKE Sandbox docs from Google name the same case: "GKE Sandbox protects your cluster from untrusted or third-party workloads."

Why it needs isolation

Code that runs on a machine can read its files, call the network and use its CPU and memory. Firecracker's design treats guest code as hostile: "all vCPU threads are considered to be running malicious code as soon as they have been started."

Why a shared kernel adds risk

A container shares the kernel of its host. OWASP says that when the host kernel is vulnerable, "the containers are also vulnerable." A microVM has its own guest kernel, so a flaw in that kernel does not reach the host kernel directly.

What to check

  • How the code is separated from the host kernel. Look for a microVM or a user-space kernel such as gVisor.
  • Whether outbound network access can be limited. Firecracker's design says that egress traffic from a guest "should be filtered at the host-level."
  • Whether CPU, memory and disk use can be limited.

Related terms

All glossary terms

Related