Skip to content

Code Security Report: 6 high severity findings, 10 total findings #13

@mend-for-github-com

Description

@mend-for-github-com

Code Security Report

Latest Scan: 2022-12-23 01:59pm
Total Findings: 10
Tested Project Files: 99
Detected Programming Languages: 1

  • Check this box to manually trigger a scan

Language: Python

Severity CWE Vulnerability Type Count
High CWE-78 Command Injection 4
High CWE-79 Cross-Site Scripting 2
Low CWE-916 Weak Hash Strength 4

Details

The below list presents the 6 high vulnerability findings that need your attention. To view information on these findings, navigate to the Mend SAST Application.

Command Injection (CWE-78) : 4

Findings

trigger/cmdi.py:6

import os
import subprocess
def do_os_system(command):
return os.system(command)

Trace

files = await request.files

stream = files.get("file")

user_input = stream.read()

def do_os_system(command):

return os.system(command)

apps/falcon_app.py:29

user_input = req._params["upload"].file.read()
digest = hexlify(md5(user_input).digest()).decode("utf8")
cmd = "echo " + str(user_input[:10])
os.system(cmd)

Trace

user_input = req._params["upload"].file.read()

cmd = "echo " + str(user_input[:10])

os.system(cmd)

trigger/cmdi.py:6

import os
import subprocess
def do_os_system(command):
return os.system(command)

Trace

content = await file.read()

def do_os_system(command):

return os.system(command)

trigger/cmdi.py:6

import os
import subprocess
def do_os_system(command):
return os.system(command)

Trace

user_input = stream.read()

def do_os_system(command):

return os.system(command)

Cross-Site Scripting (CWE-79) : 2

Findings

django/vulnerable_asgi.py:55

template = get_template("{}.html".format(name))
if name == "xss" and trigger == "raw":
template += "<p>XSS: " + user_input + "</p>"
return HttpResponse(template)

Trace

header_user_input = request.META.get("HTTP_QUERY_STRING")

user_input = await _get_user_input(request)

template += "<p>XSS: " + user_input + "</p>"

return HttpResponse(template)

django/vulnerable.py:38

template = get_template("{}.html".format(name))
if name == "xss" and trigger == "raw":
template += "<p>XSS: " + user_input + "</p>"
return HttpResponse(template)

Trace

return request.GET.get("user_input", "")

user_input = _get_user_input(request)

template += "<p>XSS: " + user_input + "</p>"

return HttpResponse(template)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions