mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge branch 'main' into henrymercer/mergeback-3.8
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
|
||||
import javascript
|
||||
import semmle.javascript.security.regexp.PolynomialReDoSQuery
|
||||
import semmle.javascript.security.regexp.SuperlinearBackTracking
|
||||
import DataFlow::PathGraph
|
||||
|
||||
from
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
|
||||
import javascript
|
||||
import semmle.javascript.security.regexp.NfaUtils
|
||||
import semmle.javascript.security.regexp.ExponentialBackTracking
|
||||
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeView
|
||||
import codeql.regex.nfa.ExponentialBackTracking::Make<TreeView>
|
||||
|
||||
from RegExpTerm t, string pump, State s, string prefixMsg
|
||||
where hasReDoSResult(t, pump, s, prefixMsg)
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
* external/cwe/cwe-020
|
||||
*/
|
||||
|
||||
import semmle.javascript.security.OverlyLargeRangeQuery
|
||||
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeView
|
||||
import codeql.regex.OverlyLargeRangeQuery::Make<TreeView>
|
||||
|
||||
from RegExpCharacterRange range, string reason
|
||||
from TreeView::RegExpCharacterRange range, string reason
|
||||
where problem(range, reason)
|
||||
select range, "Suspicious character range that " + reason + "."
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
* external/cwe/cwe-186
|
||||
*/
|
||||
|
||||
import semmle.javascript.security.BadTagFilterQuery
|
||||
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeView
|
||||
import codeql.regex.nfa.BadTagFilterQuery::Make<TreeView>
|
||||
|
||||
from HtmlMatchingRegExp regexp, string msg
|
||||
where msg = min(string m | isBadRegexpFilter(regexp, m) | m order by m.length(), m) // there might be multiple, we arbitrarily pick the shortest one
|
||||
|
||||
@@ -20,7 +20,8 @@ string toOtherCase(string s) {
|
||||
if s.regexpMatch(".*[a-z].*") then result = s.toUpperCase() else result = s.toLowerCase()
|
||||
}
|
||||
|
||||
import semmle.javascript.security.regexp.NfaUtils as NfaUtils
|
||||
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeView
|
||||
import codeql.regex.nfa.NfaUtils::Make<TreeView> as NfaUtils
|
||||
|
||||
/** Holds if `s` is a relevant regexp term were we want to compute a string that matches the term (for `getCaseSensitiveBypassExample`). */
|
||||
predicate isCand(NfaUtils::State s) {
|
||||
@@ -92,7 +93,7 @@ string getAnEndpointExample(Routing::RouteSetup endpoint) {
|
||||
)
|
||||
}
|
||||
|
||||
import semmle.javascript.security.regexp.RegexpMatching as RegexpMatching
|
||||
import codeql.regex.nfa.RegexpMatching::Make<TreeView> as RegexpMatching
|
||||
|
||||
NfaUtils::RegExpRoot getARoot(DataFlow::RegExpCreationNode creator) {
|
||||
result.getRootTerm() = creator.getRoot()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import http from 'http';
|
||||
import url from 'url';
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
var target = url.parse(req.url, true).query.target;
|
||||
const server = http.createServer(function(req, res) {
|
||||
const target = new URL(req.url, "http://example.com").searchParams.get("target");
|
||||
|
||||
// BAD: `target` is controlled by the attacker
|
||||
http.get('https://' + target + ".example.com/data/", res => {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import http from 'http';
|
||||
import url from 'url';
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
var target = url.parse(req.url, true).query.target;
|
||||
const server = http.createServer(function(req, res) {
|
||||
const target = new URL(req.url, "http://example.com").searchParams.get("target");
|
||||
|
||||
var subdomain;
|
||||
let subdomain;
|
||||
if (target === 'EU') {
|
||||
subdomain = "europe"
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @precision medium
|
||||
* @problem.severity error
|
||||
* @security-severity 5
|
||||
* @id py/predictable-token
|
||||
* @id js/predictable-token
|
||||
* @tags security
|
||||
* external/cwe/cwe-340
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user