GitHub Advisoryadvisory · Maven
GHSA-98hq-4wmw-98w9 Arbitrary code execution in de.tum.in.ase:artemis-java-test-sandbox
HIGH
Official page ↗
- Aliases
- CVE-2024-23681
- Ecosystem
- Maven
- Packages
- de.tum.in.ase:artemis-java-test-sandbox
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- Weaknesses
- CWE-284
- Reviewed
- 2023-02-10
Affected packages
• Maven de.tum.in.ase:artemis-java-test-sandbox: < 1.11.2 → fixed in 1.11.2
Description
Summary
Because of the missing `checkLink(String)` override in the SecurityManager, students can load libraries and execute arbitrary code.
Details
Using `System.load(String)` or `System.loadLibrary(String)` students can load and execute arbitrary code.
```java
private static native void start(List args);
public static void main(String[] args) {
System.load(new File("path_to_lib.so").getAbsolutePath());
start(List.of(args));
}
```
Adding this to the security manager (and a translation) should fix the issue:
```java
@Override
public void checkExec(String cmd) {
try {
if (enterPublicInterface())
return;
throw new SecurityException(localized("security.error_link")); //$NON-NLS-1$
} finally {
exitPublicInterface();
}
}
```
PoC
See details.
Impact
Arbitrary code execution.
Related
Alias · CVE (1)
- CVE-2024-23681 Artemis Java Test Sandbox versions before 1.11.2 are vulnerable to a sandbox escape when an attacker loads untrusted libraries using… vulnerability
Weakness · CWE (1)
- CWE-284 Improper Access Control weakness