Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS05OGhxLTR3bXctOTh3Oc4AAxiI

Arbitrary code execution in de.tum.in.ase:artemis-java-test-sandbox

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.

private static native void start(List<String> 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:

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

Permalink: https://github.com/advisories/GHSA-98hq-4wmw-98w9
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS05OGhxLTR3bXctOTh3Oc4AAxiI
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 1 year ago
Updated: about 1 year ago


CVSS Score: 8.3
CVSS vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Identifiers: GHSA-98hq-4wmw-98w9
References: Repository: https://github.com/ls1intum/Ares
Blast Radius: 6.5

Affected Packages

maven:de.tum.in.ase:artemis-java-test-sandbox
Dependent packages: 0
Dependent repositories: 6
Downloads:
Affected Version Ranges: < 1.11.2
Fixed in: 1.11.2
All affected versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.5, 1.7.6, 1.8.0, 1.9.0, 1.9.1, 1.9.2, 1.10.0, 1.10.1, 1.11.0, 1.11.1
All unaffected versions: 1.11.2, 1.11.3, 1.12.0, 1.13.0