Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6cb2ca6

Browse files
committed
Python: tests to show modeling is very syntactical
1 parent 3af5c72 commit 6cb2ca6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

python/ql/test/experimental/library-tests/frameworks/stdlib/SystemCommandExecution.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ def os_members():
111111

112112
os.spawnl(os.P_WAIT, "/bin/sh", "<progname>", "-c", "vuln") # $SystemCommandExecution_getCommand="/bin/sh" $f-:SystemCommandExecution_getCommand="vuln"
113113

114+
115+
########################################
116+
# Passing arguments by reference
117+
118+
args = ["/bin/sh", "-c", "vuln"]
119+
subprocess.Popen(args) # $SystemCommandExecution_getCommand=args
120+
121+
args = "<progname>"
122+
use_shell = False
123+
exe = "executable"
124+
subprocess.Popen(args, shell=use_shell, executable=exe) # $f+:SystemCommandExecution_getCommand=args $SystemCommandExecution_getCommand=exe
125+
126+
114127
################################################################################
115128
# Taint related
116129

0 commit comments

Comments
 (0)