mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Swift: Get the IncompleteHostnameRegex query working for Swift.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Provides predicates for reasoning about regular expressions
|
||||
* that match URLs and hostname patterns.
|
||||
*/
|
||||
|
||||
deprecated import semmle.javascript.security.regexp.HostnameRegexp as Dep
|
||||
import Dep
|
||||
@@ -3,16 +3,19 @@
|
||||
* that match URLs and hostname patterns.
|
||||
*/
|
||||
|
||||
private import javascript as JS
|
||||
private import semmle.javascript.security.regexp.RegExpTreeView::RegExpTreeView as TreeImpl
|
||||
private import semmle.javascript.Regexp as RegExp
|
||||
private import swift
|
||||
private import codeql.swift.dataflow.DataFlow
|
||||
private import codeql.swift.regex.Regex as Regex
|
||||
private import codeql.swift.regex.RegexTreeView::RegexTreeView as TreeImpl
|
||||
private import codeql.regex.HostnameRegexp as Shared
|
||||
|
||||
/** An implementation of the signature that allows the Hostname analysis to run. */
|
||||
/**
|
||||
* An implementation of the signature that allows the Hostname analysis to run.
|
||||
*/
|
||||
module Impl implements Shared::HostnameRegexpSig<TreeImpl> {
|
||||
class DataFlowNode = JS::DataFlow::Node;
|
||||
class DataFlowNode = DataFlow::Node;
|
||||
|
||||
class RegExpPatternSource = RegExp::RegExpPatternSource;
|
||||
class RegExpPatternSource = Regex::RegexPatternSource;
|
||||
}
|
||||
|
||||
import Shared::Make<TreeImpl, Impl>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
* @problem.severity warning
|
||||
* @security-severity 7.8
|
||||
* @precision high
|
||||
* @id js/incomplete-hostname-regexp
|
||||
* @id swift/incomplete-hostname-regexp
|
||||
* @tags correctness
|
||||
* security
|
||||
* external/cwe/cwe-020
|
||||
*/
|
||||
|
||||
private import semmle.javascript.security.regexp.HostnameRegexp as HostnameRegexp
|
||||
private import codeql.swift.security.regex.HostnameRegex as HostnameRegex
|
||||
|
||||
query predicate problems = HostnameRegexp::incompleteHostnameRegExp/4;
|
||||
query predicate problems = HostnameRegex::incompleteHostnameRegExp/4;
|
||||
|
||||
Reference in New Issue
Block a user