Skip to content

Commit 1f7ac2f

Browse files
committed
[GR-12241] Disallow os.system if no native/host access is allowed
1 parent 279043a commit 1f7ac2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PosixModuleBuiltins.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,9 @@ public void run() {
10321032
@TruffleBoundary
10331033
@Specialization
10341034
int system(String cmd) {
1035+
if (!getContext().isExecutableAccessAllowed()) {
1036+
return -1;
1037+
}
10351038
String[] command = new String[]{shell[0], shell[1], cmd};
10361039
try {
10371040
Runtime rt = Runtime.getRuntime();

0 commit comments

Comments
 (0)