bandit/examples/imports-aliases.py
Tim Kelsey 055598028a Adding a test for partial paths in exec functions
When using functions like subprocess.Popen etc to launch an
external executable, the full path should be given. This prevents
an attacker from manipulting the search path or placing a bogus
executable that will be launched instead of the intended one.

Change-Id: I4a11f988bc3e954331ab0f0902ea849c6ec31888
2015-07-02 19:20:16 +01:00

16 lines
295 B
Python

from subprocess import Popen as pop
import hashlib as h
import hashlib as hh
import hashlib as hhh
import hashlib as hhhh
from pickle import loads as lp
import pickle as p
pop('/bin/gcc --version', shell=True)
h.md5('1')
hh.md5('2')
hhh.md5('3').hexdigest()
hhhh.md5('4')
lp({'key': 'value'})