Skip to main content

Semgrep trophy case

This is a list of vulnerabilities found and security fixes made with Semgrep. Add yours with a pull request!

CVEs
CVESemgrep ruleAffected softwareDescription
CVE-2019-5479javascript.lang.security.detect-non-literal-requirelarbitbase-api < v0.5.5An unintended require vulnerability in <v0.5.5 larvitbase-api may allow an attacker to load arbitrary non-production code (JavaScript file).
CVE-2020-8128javascript.lang.security.detect-non-literal-requirejsreport < 2.5.0An unintended require and server-side request forgery vulnerabilities in jsreport version 2.5.0 and earlier allow attackers to execute arbitrary code.
CVE-2020-8129javascript.lang.security.detect-non-literal-requirescript-manager < 0.8.6An unintended require vulnerability in script-manager npm package version 0.8.6 and earlier may allow attackers to execute arbitrary code.
CVE-2020-7739javascript.phantom.security.audit.phantom-injectionphantomjs-seoThis affects all versions of package phantomjs-seo. It is possible for an attacker to craft a url that will be passed to a PhantomJS instance allowing for an SSRF attack.
CVE-2020-7740javascript.wkhtmltopdf.security.audit.wkhtmltopdf-injectionnode-pdf-generatorThis affects all versions of package node-pdf-generator. Due to lack of user input validation and sanitization done to the content given to node-pdf-generator, it is possible for an attacker to craft a url that will be passed to an external server allowing an SSRF attack.
CVE-2020-7749javascript.puppeteer.security.audit.puppeteer-setcontent-injectionosm-static-mapsThis affects all versions of package osm-static-maps. User input given to the package is passed directly to a template without escaping ({{{ ... }}}). As such, it is possible for an attacker to inject arbitrary HTML/JS code and depending on the context. It will be outputted as an HTML on the page which gives opportunity for XSS or rendered on the server (puppeteer) which also gives opportunity for SSRF and Local File Read.
CVE-2020-8492contrib.dlint.redos.dlint-catastrophic-redosPython 2.7-2.717, 3.7-3.5.9, 3.6-3.6.10, 3.7-3.7.6, and 3.8-3.8.1Python 2.7 through 2.7.17, 3.5 through 3.5.9, 3.6 through 3.6.10, 3.7 through 3.7.6, and 3.8 through 3.8.1 allows an HTTP server to conduct Regular Expression Denial of Service (ReDoS) attacks against a client because of urllib.request.AbstractBasicAuthHandler catastrophic backtracking.
CVE-2020-6817contrib.dlint.redos.dlint-catastrophic-redosMozilla Bleach < 3.1.4bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS.
Open Source Contributions
Affected softwareSemgrep ruleDescription
Poetrycontrib.dlint.redos.dlint-catastrophic-redosThis ReDoS occurs due to r"(?:(?P<user>.+)@)*" in both expressions. This is due to nested quantifiers with overlapping character space.
Coloramacontrib.dlint.redos.dlint-catastrophic-redosThe ReDoS occurs due to `'\001?\033\]((?:.
Bottlecontrib.dlint.redos.dlint-catastrophic-redosA special subject string can be crafted to cause it to catastrophic backtracking. The culprit here is this portion of the expression: `((?:\\.
Splunk SDK Pythoncontrib.dlint.redos.dlint-catastrophic-redosThe finding in internals.py at line 235 occurs due to `(?:\.
requests-gssapicontrib.dlint.redos.dlint-catastrophic-redosDenial-of-service (DoS) bug in requests_kerberos.kerberos_._negotiate_value. In particular, the (?:.*,)* portion of the regular expression causes catastrophic backtracking. Since "." and "," overlap and there are nested quantifiers we can cause catastrophic backtracking by repeating a comma. This means a server can send a specially crafted header along with an HTTP 401 and cause a DoS on the client.
Open EdXpython.requests.security.disabled-cert-validationSSL certifcation is disabled in order to accept self-signed certificates.
RPyCpython.lang.correctness.common-mistakes.default-mutable-dictIn python, the default values of function parameters are instantiated at function definition time. All calls to that function that use the default value all point to the same global object. Because of this, two instances of Server (initialized without passing in a protocol_config option) actually share the same protocol_config. So modifying one server's config affects the other ones.
CMakepython.lang.correctness.common-mistakes.default-mutable-dictConvertMSBuildXMLToJSON: Fix python mutable default data structure
lte-template-flaskpython.flask.security.unescaped-template-extensionPassing the host parameter to your jinja template in views.py:63. lis_person_name_full comes from request.form.get('lis_person_name_full'). This line may be susceptible to XSS attacks. I went ahead and html-escaped the lis_person_name_full variable in launch.htm.j2 file using the `{{value
netskrafl.ispython.flask.security.xss.audit.template-unescaped-with-safeThe `
pdfcpugo.lang.correctness.useless-eqeq.eqeq-is-badIt looks like this test case in pkg/pdfcpu/image_test.go was intending to compare bb1 with bb2, but it was comparing bb1 twice.