Skip to content
RCE Write-up Intermediate

Exploiting Symlinks: A Deep Dive into CVE-2024–28185 and CVE-2024–28189 of Judge0 Sandboxes

Judge0 failed to properly handle symbolic links in its sandbox, allowing an attacker to redirect file writes to arbitrary locations outside the sandbox. This could lead to unsandboxed code execution and full compromise of the host system.

elniak Follow

Published on infosecwriteups.com

Today, we’re delving into two particularly concerning vulnerabilities identified as CVE-2024–28185 and CVE-2024–28189 (both CVSS of 10.0) These vulnerabilities exploit symbolic links (symlinks) to manipulate the Judge0 platform, potentially leading to unauthorized access and control over affected systems.

ElNiak, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application followed symbolic links when performing file operations without verifying that the target remained within the sandbox directory.

Impact

An attacker could gain unsandboxed code execution on the Docker container, escalate privileges, access the host filesystem, and potentially take full control of the Judge0 system and network resources.

What the attacker needed

Ability to create symlinks in sandbox; ability to submit code to Judge0

The fix

Patches were deployed to secure file operations against symlink attacks and enforce stricter permissions within the containerized environment.

How it was found

  1. Create a symlink named run_script pointing to a file outside the sandbox.
  2. Submit code that causes Judge0 to write to run_script, which follows the symlink and writes to the target file.
  3. The attacker can then execute code outside the sandbox by leveraging the written file.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A symbolic link (symlink) is like a shortcut that points to another file. Judge0, a system for running code safely, did not check if a file it was about to write to was actually a symlink. An attacker could create a symlink that pointed outside the safe area, so when Judge0 wrote to it, it actually wrote to a sensitive file on the host, letting the attacker run their own code on the machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by elniak

View all

28 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.