---
title: "CAPEC-237: Escaping a Sandbox by Calling Code in Another Language"
url: https://radicalnotion.ai/capec/capec-237
type: capec
description: "The attacker may submit malicious code of another language to obtain access to privileges that were not intentionally exposed by the sandbox, thus escaping the sandbox. For instance, Java code cannot perform unsafe operations, such as modifying arbitrary memory locations, due to restrictions placed on it by the Byte code Verifier and the JVM. If allowed, Java code can call directly into native C code, which may perform unsafe operations, such as call system calls and modify arbitrary memory locations on their behalf. To provide isolation, Java does not grant untrusted code with unmediated access to native C code. Instead, the sandboxed code is typically allowed to call some subset of the pre-existing native code that is part of standard libraries."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-237: Escaping a Sandbox by Calling Code in Another Language

- **Abstraction:** Detailed
- **Status:** Draft
- **Typical severity:** Very High
- **Likelihood of attack:** Low
- **CAPEC catalog version:** 3.9

## Description

The attacker may submit malicious code of another language to obtain access to privileges that were not intentionally exposed by the sandbox, thus escaping the sandbox. For instance, Java code cannot perform unsafe operations, such as modifying arbitrary memory locations, due to restrictions placed on it by the Byte code Verifier and the JVM. If allowed, Java code can call directly into native C code, which may perform unsafe operations, such as call system calls and modify arbitrary memory locations on their behalf. To provide isolation, Java does not grant untrusted code with unmediated access to native C code. Instead, the sandboxed code is typically allowed to call some subset of the pre-existing native code that is part of standard libraries.

## Execution flow

### Step 1: Explore

\[Probing\] The attacker probes the target application to see whether calling code of another language is allowed within a sandbox.

- The attacker probes the target application to see whether calling code of another language is allowed within a sandbox.

### Step 2: Explore

\[Analysis\] The attacker analyzes the target application to get a list of cross code weaknesses in the standard libraries of the sandbox.

- The attacker analyzes the target application to get a list of cross code weaknesses in the standard libraries of the sandbox.

### Step 3: Experiment

\[Verify the exploitable security weaknesses\] The attacker tries to craft malicious code of another language allowed by the sandbox to verify the security weaknesses of the standard libraries found in the Explore phase.

- The attacker tries to explore the security weaknesses by calling malicious code of another language allowed by the sandbox.

### Step 4: Exploit

\[Exploit the security weaknesses in the standard libraries\] The attacker calls malicious code of another language to exploit the security weaknesses in the standard libraries verified in the Experiment phase. The attacker will be able to obtain access to privileges that were not intentionally exposed by the sandbox, thus escaping the sandbox.

- The attacker calls malicious code of another language to exploit the security weaknesses in the standard libraries.

## Skills required

- **High:** The attacker must have a good knowledge of the platform specific mechanisms of signing and verifying code. Most code signing and verification schemes are based on use of cryptography, the attacker needs to have an understand of these cryptographic operations in good detail.

## Resources required

- None: No specialized resources are required to execute this type of attack.

## Consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control, Authorization | Bypass Protection Mechanism | - |
| Authorization | Execute Unauthorized Commands | Run Arbitrary Code |
| Accountability, Authentication, Authorization, Non-Repudiation | Gain Privileges | - |

## Mitigations

- Assurance: Sanitize the code of the standard libraries to make sure there is no security weaknesses in them.
- Design: Use obfuscation and other techniques to prevent reverse engineering the standard libraries.
- Assurance: Use static analysis tool to do code review and dynamic tool to do penetration test on the standard library.
- Configuration: Get latest updates for the computer.

## Example instances

Exploit: Java/ByteVerify.C is a detection of malicious code that attempts to exploit a vulnerability in the Microsoft Virtual Machine (VM). The VM enables Java programs to run on Windows platforms. The Microsoft Java VM is included in most versions of Windows and Internet Explorer. In some versions of the Microsoft VM, a vulnerability exists because of a flaw in the way the ByteCode Verifier checks code when it is initially being loaded by the Microsoft VM. The ByteCode Verifier is a low level process in the Microsoft VM that is responsible for checking the validity of code - or byte code - as it is initially being loaded into the Microsoft VM. Java/ByteVerify.C attempts to download a file named "msits.exe", located in the same virtual directory as the Java applet, into the Windows system folder, and with a random file name. It then tries to execute this specific file. This flaw enables attackers to execute arbitrary code on a user's machine such as writing, downloading and executing additional malware. This vulnerability is addressed by update MS03-011, released in 2003.

## Related weaknesses (CWE)

- [CWE-693](https://radicalnotion.ai/cwe/cwe-693): Protection Mechanism Failure

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-480](https://radicalnotion.ai/capec/capec-480) | Escaping Virtualization |

## Frequently asked questions

### What is CAPEC-237?

The attacker may submit malicious code of another language to obtain access to privileges that were not intentionally exposed by the sandbox, thus escaping the sandbox. For instance, Java code cannot perform unsafe operations, such as modifying arbitrary memory locations, due to restrictions placed on it by the Byte code Verifier and the JVM. If allowed, Java code can call directly into native C code, which may perform unsafe operations, such as call system calls and modify arbitrary memory locations on their behalf. To provide isolation, Java does not grant untrusted code with unmediated access to native C code. Instead, the sandboxed code is typically allowed to call some subset of the pre-existing native code that is part of standard libraries.

### How does a Escaping a Sandbox by Calling Code in Another Language attack work?

It typically unfolds over 4 phases. It begins with: \[Probing\] The attacker probes the target application to see whether calling code of another language is allowed within a sandbox.

### How do you prevent CAPEC-237?

Assurance: Sanitize the code of the standard libraries to make sure there is no security weaknesses in them.

### What weaknesses does CAPEC-237 target?

CAPEC-237 exploits one CWE weakness: CWE-693 (Protection Mechanism Failure).

### How severe is CAPEC-237?

MITRE rates CAPEC-237 as Very High severity with low likelihood of attack.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/237.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-237). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
