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

Skip to content

Commit 27a7d09

Browse files
committed
Python: Fix minor problems in security examples
1 parent 5bc5925 commit 27a7d09

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

python/ql/src/Security/CWE-022/examples/tainted_path.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
def user_picture1(request):
1313
"""A view that is vulnerable to malicious file access."""
14-
base_path = '/server/static/images'
1514
filename = request.GET.get('p')
1615
# BAD: This could read any file on the file system
1716
data = open(filename, 'rb').read()

python/ql/src/Security/CWE-078/examples/command_injection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ def command_execution_safe(request):
2020
if request.method == 'POST':
2121
action = request.POST.get('action', '')
2222
#GOOD -- Use a whitelist
23-
subprocess.call(["application", COMMAND[action]])
24-
23+
subprocess.call(["application", COMMANDS[action]])

0 commit comments

Comments
 (0)