filename
stringlengths 5
36
| vulnerability
stringclasses 43
values | description
stringclasses 56
values | insecure_code
stringlengths 11
347
|
---|---|---|---|
tag.terms.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | data-message-one="{{ i18n "global.tags_found.one" }}" |
tag.terms.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | data-message-other="{{ i18n "global.tags_found.other" }}"></h4> |
tag.terms.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | <a class="link-unstyled" href="{{ .Name | urlize }}"> |
tag.terms.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | <a class="archive-post-title" href="{{ .Permalink }}"> |
wide-image.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | <img class="figure-img" src="{{ .Get "src" }}" {{ with (.Get "title") }}alt="{{ . }}"{{ end }} />{{ with (.Get "title") }}<span class="caption">{{ . }}</span>{{ end }} |
wide-image.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | <img class="figure-img" src="{{ .Get "src" }}" {{ with (.Get "title") }}alt="{{ . }}"{{ end }} />{{ with (.Get "title") }}<span class="caption">{{ . }}</span>{{ end }} |
wide-image.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | <img class="figure-img" src="{{ .Get "src" }}" {{ with (.Get "title") }}alt="{{ . }}"{{ end }} />{{ with (.Get "title") }}<span class="caption">{{ . }}</span>{{ end }} |
flipnote_fetcher.py | python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected | Detected a dynamic value being used with urllib. urllib supports 'file://' schemes, so a dynamic value controlled by a malicious actor may allow them to read arbitrary files. Audit uses of urllib calls to ensure user data cannot control the URLs, or consider using the 'requests' library instead. | with urllib.request.urlopen(url) as response: |
flipnote_fetcher.py | python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected | Detected a dynamic value being used with urllib. urllib supports 'file://' schemes, so a dynamic value controlled by a malicious actor may allow them to read arbitrary files. Audit uses of urllib calls to ensure user data cannot control the URLs, or consider using the 'requests' library instead. | urllib.request.urlretrieve(flipnote_url, output_path.joinpath(flipnote_filename)) |
CustomSpelParser.java | java.spring.security.audit.spel-injection.spel-injection | A Spring expression is built with a dynamic value. The source of the value(s) should be verified to avoid that unfiltered values fall into this risky code evaluation. | public static String getDynamicValue(String[] parameterNames, Object[] args, String key) { |
apod.go | go.lang.security.audit.crypto.math_random.math-random-used | Do not use `math/rand`. Use `crypto/rand` instead. | "math/rand" |
footer.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | {% if meta.episode %}<a href="{{ meta.episode }}">Watch It Get Built</a>{% |
footer.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | endif %}{% if meta.tutorial %}<a href="{{ meta.tutorial }}">Tutorial</a>{% |
index.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | <li><a href="{{ config.site_url }}" class="btn"><span>Back to site →</span></a></li> |
index.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | {% autoescape false %}{{ post }}{% endautoescape %} |
build_sorting_libs.py | python.lang.security.audit.subprocess-shell-true.subprocess-shell-true | Found 'subprocess' function 'check_call' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. | subprocess.check_call(cmd, shell=True) |
action_vm.py | python.lang.security.audit.subprocess-shell-true.subprocess-shell-true | Found 'subprocess' function 'call' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. | subprocess.call(comando_vmrc, shell=True) |
alarm.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.etree.ElementTree import Element |
alarm.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.etree.ElementTree import SubElement |
alarm.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.etree.ElementTree import tostring |
alarm.py | python.requests.security.disabled-cert-validation.disabled-cert-validation | Certificate verification has been explicitly disabled. This permits insecure connections to insecure servers. Re-enable certification validation. | res = requests.post(url=url, data=payload, headers={ |
torissh.go | go.lang.security.audit.crypto.insecure_ssh.avoid-ssh-insecure-ignore-host-key | Disabled host key verification detected. This allows man-in-the-middle attacks. Use the 'golang.org/x/crypto/ssh/knownhosts' package to do host key verification. See https://skarlso.github.io/2019/02/17/go-ssh-with-host-key-verification/ to learn more about the problem and how to fix it. | HostKeyCallback: ssh.InsecureIgnoreHostKey(), |
run.py | python.flask.security.audit.hardcoded-config.avoid_hardcoded_config_SECRET_KEY | Hardcoded variable `SECRET_KEY` detected. Use environment variables or config files instead | app.config['SECRET_KEY'] = 'super secret key' |
run.py | python.flask.security.audit.hardcoded-config.avoid_hardcoded_config_DEBUG | Hardcoded variable `DEBUG` detected. Set this by using FLASK_DEBUG environment variable | app.config['DEBUG'] = True |
run.py | python.flask.security.audit.app-run-param-config.avoid_app_run_with_bad_host | Running flask app with host 0.0.0.0 could expose the server publicly. | app.run(host='0.0.0.0', port=port) |
unsafe.go | go.lang.security.audit.unsafe.use-of-unsafe-block | Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. | return *(*string)(unsafe.Pointer(&b)) |
unsafe.go | go.lang.security.audit.unsafe.use-of-unsafe-block | Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. | return *(*[]byte)(unsafe.Pointer( |
taskRunner.js | javascript.lang.security.detect-child-process.detect-child-process | Detected calls to child_process from a function argument `cmd`. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. | const child = spawn(name, arr, { |
array.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | $('.f-{{ key }}').select2({ tags: {% if data %}{% autoescape false %}{{ data|json }}{% endautoescape %}{% else %}[]{% endif %} }); |
array.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | $('.f-{{ key }}').select2({ tags: {% if data %}{% autoescape false %}{{ data|json }}{% endautoescape %}{% else %}[]{% endif %} }); |
array.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | $('.f-{{ key }}').select2({ tags: {% if data %}{% autoescape false %}{{ data|json }}{% endautoescape %}{% else %}[]{% endif %} }); |
array.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'array'); |
array.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'array'); |
authorize.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | window.onload = function() { |
datetime.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | $('#f-{{ key }}').datetimepicker({ |
depends.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | depends({% autoescape false %}{{ data|json }}{% endautoescape %}, '{{ alias }}'); |
filter.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | {% autoescape false %}{{ sfilter }}{% endautoescape %} |
list.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | {% autoescape false %}{{ upload }}{% endautoescape %} |
new.html | python.flask.security.xss.audit.template-autoescape-off.template-autoescape-off | Detected a segment of a Flask template where autoescaping is explicitly disabled with '{% autoescape off %}'. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability, or turn autoescape on. | {% autoescape false %}{{ form }}{% endautoescape %} |
new.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | mlMenu.init('menu-{{ appName }}'); |
number.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'number'); |
number.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'number'); |
number.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | {{ m_depends.depends(field.depends, field.alias) }} |
select.html | generic.html-templates.security.unquoted-attribute-var.unquoted-attribute-var | Detected a unquoted template variable as an attribute. If unquoted, a malicious actor could inject custom JavaScript handlers. To fix this, add quotes around the template expression, like this: "{{ expr }}". | <option {{ selected }} value="{{ value }}">{{ label }}</option> |
signin.html | generic.html-templates.security.var-in-href.var-in-href | Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using Flask, use 'url_for()' to safely generate a URL. If using Django, use the 'url' filter to safely generate a URL. If using Mustache, use a URL encoding library, or prepend a slash '/' to the variable for relative links (`href="/{{link}}"`). You may also consider setting the Content Security Policy (CSP) header. | <a href="{{ config.url.signin }}?client_id={{ client_id }}&redirect_uri={{ redirect_uri }}" class="btn btn-lg btn-primary btn-block">Sign in</a> |
text.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'text'); |
text.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'text'); |
text.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | {{ m_depends.depends(field.depends, field.alias) }} |
textarea.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'textarea'); |
textarea.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | setFilter(Filter, '{{ key }}', '{{ field.alias }}', 'textarea'); |
textarea.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | {{ m_depends.depends(field.depends, field.alias) }} |
auth.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(ppp_settings.our_name, ppp_settings.hostname); |
auth.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(ppp_settings.user, ppp_settings.our_name); |
auth.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(user, "none"); |
auth.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(passwd, "none"); |
chap.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strncpy(rhostname, ppp_settings.remote_name, sizeof(rhostname)); |
chap.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(msg, "Welcome!"); |
chap.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(msg, "I don't like you. Go 'way."); |
ota-tftp.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy((char *)&err_buf[2], err_msg); |
ssl_client2.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strncpy( (char *) buf + len, GET_REQUEST_END, sizeof(buf) - len - 1 ); |
unaligned_load.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy(buf, string); |
unaligned_load.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strcpy((char *)frc1_buf, iramtest); |
websocket_send.c | c.lang.security.insecure-use-strtok-fn.insecure-use-strtok-fn | Avoid using 'strtok()'. This function directly modifies the first argument buffer, permanently erasing the delimiter character. Use 'strtok_r()' instead. | token = strtok(recv_buf, "\r\n\r\n"); |
x509write_crt.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strncpy( ctx->not_before, not_before, MBEDTLS_X509_RFC5280_UTC_TIME_LEN ); |
x509write_crt.c | c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn | Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be available). | strncpy( ctx->not_after , not_after , MBEDTLS_X509_RFC5280_UTC_TIME_LEN ); |
setup.py | python.lang.security.audit.exec-detected.exec-detected | Detected the use of exec(). exec() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | exec(abt, about) |
utils.py | python.lang.security.unverified-ssl-context.unverified-ssl-context | Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use 'ssl.create_default_context' instead. | r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15) |
utils.py | python.lang.security.unverified-ssl-context.unverified-ssl-context | Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use 'ssl.create_default_context' instead. | r = urllib2.urlopen(req, context=ssl._create_unverified_context(), timeout=15) |
__init__.py | python.lang.security.audit.exec-detected.exec-detected | Detected the use of exec(). exec() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | exec(script.as_string()) |
vi_display.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.dom import minidom |
vi_display.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | res = [v[livires] for v in verts] if not self.scene.vi_res_mod else [eval('{}{}'.format(v[livires], self.scene.vi_res_mod)) for v in verts] |
vi_func.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.dom import minidom |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | return (eval('{}{}'.format(scene.vi_leg_min, scene.vi_res_mod)), eval('{}{}'.format(scene.vi_leg_max, scene.vi_res_mod))) |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | return (eval('{}{}'.format(scene.vi_leg_min, scene.vi_res_mod)), eval('{}{}'.format(scene.vi_leg_max, scene.vi_res_mod))) |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | return [eval('{}{}'.format(r, scene.vi_res_mod)) for r in reslist] |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | dimen = [eval(path.getAttribute('height').strip('pt')) for path in svg.getElementsByTagName('svg')][0] |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | sposnew = [[(eval(ss.split()[ss.index('M') + 1]) - dimen/2) * 0.1, (eval(ss.split()[ss.index('M') + 2]) - dimen/2) * -0.1, 0.05] for ss in pos_strings] |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | sposnew = [[(eval(ss.split()[ss.index('M') + 1]) - dimen/2) * 0.1, (eval(ss.split()[ss.index('M') + 2]) - dimen/2) * -0.1, 0.05] for ss in pos_strings] |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | lposnew = [[[(eval(ss.split()[li + 1]) - dimen/2) * 0.1, (eval(ss.split()[li + 2]) - dimen/2) * -0.1, 0.05] for li in [si for si, s in enumerate(ss.split()) if s == 'L']] for ss in pos_strings] |
vi_func.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | lposnew = [[[(eval(ss.split()[li + 1]) - dimen/2) * 0.1, (eval(ss.split()[li + 2]) - dimen/2) * -0.1, 0.05] for li in [si for si, s in enumerate(ss.split()) if s == 'L']] for ss in pos_strings] |
vi_operators.py | python.lang.security.audit.subprocess-shell-true.subprocess-shell-true | Found 'subprocess' function 'Popen' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. | catrun = Popen(catcmd, stdout = PIPE, shell = True) |
vi_operators.py | python.lang.security.audit.eval-detected.eval-detected | Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources. | headerdict[lines[l].split()[0]] = eval(lines[l].split()[1]) |
viexperiments.py | python.lang.security.use-defused-xml.use-defused-xml | The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. | from xml.dom import minidom |
index.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | Device ID: {{deviceId}} <br> |
index.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | Status: {{state}} </br> |
index.html | generic.html-templates.security.var-in-script-tag.var-in-script-tag | Detected a template variable used in a script tag. Although template variables are HTML escaped, HTML escaping does not always prevent cross-site scripting (XSS) attacks when used directly in JavaScript. If you need this data on the rendered page, consider placing it in the HTML portion (outside of a script tag). Alternatively, use a JavaScript-specific encoder, such as the one available in OWASP ESAPI. For Django, you may also consider using the 'json_script' template tag and retrieving the data in your script by using the element ID (e.g., `document.getElementById`). | Temperature: {{temp}} |
youtube_stream.py | python.lang.security.audit.subprocess-shell-true.subprocess-shell-true | Found 'subprocess' function 'Popen' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. | stream_pipe = subprocess.Popen(stream_cmd, shell=True, stdin=subprocess.PIPE) |
test.rb | ruby.lang.security.file-disclosure.file-disclosure | Special requests can determine whether a file exists on a filesystem that's outside the Rails app's root directory. To fix this, set config.serve_static_assets = false. | config.serve_static_assets = true |
application_controller.rb | ruby.lang.security.missing-csrf-protection.missing-csrf-protection | Detected controller which does not enable cross-site request forgery protections using 'protect_from_forgery'. Add 'protect_from_forgery :with => :exception' to your controller class. | class ApplicationController < ActionController::Base |
production.rb | ruby.lang.security.file-disclosure.file-disclosure | Special requests can determine whether a file exists on a filesystem that's outside the Rails app's root directory. To fix this, set config.serve_static_assets = false. | config.serve_static_assets = true |
ssl.rb | ruby.lang.security.ssl-mode-no-verify.ssl-mode-no-verify | Detected SSL that will accept an unverified connection. This makes the connections susceptible to man-in-the-middle attacks. Use 'OpenSSL::SSL::VERIFY_PEER' instead. | OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE |
test.rb | ruby.lang.security.file-disclosure.file-disclosure | Special requests can determine whether a file exists on a filesystem that's outside the Rails app's root directory. To fix this, set config.serve_static_assets = false. | config.serve_static_assets = true |
Test.c | c.lang.security.insecure-use-scanf-fn.insecure-use-scanf-fn | Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' instead for reading input. | scanf("%s",file_name);//comment this line if you dont want the filename prompt |
henrik.c | c.lang.security.insecure-use-gets-fn.insecure-use-gets-fn | Avoid 'gets()'. This function does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' or 'gets_s()' instead. | gets(file_name); |
main.c | c.lang.security.insecure-use-scanf-fn.insecure-use-scanf-fn | Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' instead for reading input. | scanf("%s",file_name);//comment this line if you dont want the filename prompt |
main_finished.c | c.lang.security.insecure-use-scanf-fn.insecure-use-scanf-fn | Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' instead for reading input. | scanf("%s",file_name); |
MainActivity.java | java.lang.security.audit.crypto.weak-random.weak-random | Detected use of the functions `Math.random()` or `java.util.Random()`. These are both not cryptographically strong random number generators (RNGs). If you are using these RNGs to create passwords or secret tokens, use `java.security.SecureRandom` instead. | int random = new Random().nextInt(users.size()); |
ChatReceiveThread.java | java.lang.security.audit.crypto.unencrypted-socket.unencrypted-socket | Detected use of a Java socket that is not encrypted. As a result, the traffic could be read by an attacker intercepting the network traffic. Use an SSLSocket created by 'SSLSocketFactory' or 'SSLServerSocketFactory' instead. | msgServer = new ServerSocket(msgRcvPort); |
ChatReceiveThread.java | java.lang.security.audit.object-deserialization.object-deserialization | Found object deserialization using ObjectInputStream. Deserializing entire Java objects is dangerous because malicious actors can create Java object streams with unintended consequences. Ensure that the objects being deserialized are not user-controlled. If this must be done, consider using HMACs to sign the data stream to make sure it is not tampered with, or consider only transmitting object fields and populating a new object. | inStream = new ObjectInputStream(serverSocket.getInputStream()); |
ChatSendThread.java | java.lang.security.audit.crypto.unencrypted-socket.unencrypted-socket | Detected use of a Java socket that is not encrypted. As a result, the traffic could be read by an attacker intercepting the network traffic. Use an SSLSocket created by 'SSLSocketFactory' or 'SSLServerSocketFactory' instead. | messageSenderSocket = new Socket(serverIP, messageSendPort); |
Subsets and Splits