Describe the bug
Given a test not annotated with @AllowLocalPort, it is still possible for student code to acces the internet and local ports. (The local port part is not tested in artemis itself but locally but I'm more conserned with internet access.)
To Reproduce
Create a new programming exercise
Clear all classes in tests and solution
Add in solution repository:
package xyz;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
public class ReachingWeb {
public static int googleCode() throws IOException {
URL url = new URL("http://google.com");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
return con.getResponseCode();
}
}
Expected behavior
Security manager should prevent internet acces.
Desktop (please complete the following information):
OS: Windows
IDE: IntelliJ
Ares-Version: 1.13.0
Also applies to docker image ls1tum/artemis-maven-template:java17-21
Additional context
In the security manager, checkForNonWhitelistedStackFrames gets called but getNonWhitelistedStackFrames does not return the stackframe from ReachingWeb because a takeWhile cuts it of:
Describe the bug Given a test not annotated with
@AllowLocalPort
, it is still possible for student code to acces the internet and local ports. (The local port part is not tested in artemis itself but locally but I'm more conserned with internet access.)To Reproduce
Expected behavior Security manager should prevent internet acces.
Desktop (please complete the following information):
Also applies to docker image
ls1tum/artemis-maven-template:java17-21
Additional context In the security manager, checkForNonWhitelistedStackFrames gets called but
getNonWhitelistedStackFrames
does not return the stackframe from ReachingWeb because a takeWhile cuts it of: