CVE-2024-28185 Judge0 vulnerable to Sandbox Escape via Symbolic Link
Attackers can escape the sandbox and execute arbitrary code by creating symbolic links in the submission directory, affecting Judge0 deployments.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2024-28185?
CVE-2024-28185 is a critical path traversal vulnerability in judge0, published on 18 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Judge0 is an open-source online code execution system. The application does not account for symlinks placed inside the sandbox directory, which can be leveraged by an attacker to write to arbitrary files and gain code execution outside of the sandbox. When executing a submission, Judge0 writes a `run_script` to the sandbox directory. The security issue is that an attacker can create a symbolic link (symlink) at the path `run_script` before this code is executed, resulting in the `f.write` writing to an arbitrary file on the unsandboxed system. An attacker can leverage this vulnerability to overwrite scripts on the system and gain code execution outside of the sandbox.
Which versions are affected by CVE-2024-28185?
How do I fix CVE-2024-28185?
No fix has been published for CVE-2024-28185 yet. Limit exposure of the affected software until one is available.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-28185 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28185 exists.
Public exploit code: 1 Metasploit module.
Sources
Also known as GHSA-h9g2-45c8-89cf.