Fix - Incomplete regular expression for hostnames (#1993)
Fixed the codeql issue ``` Sanitizing untrusted URLs is an important technique for preventing attacks such as request forgeries and malicious redirections. Often, this is done by checking that the host of a URL is in a set of allowed hosts. If a regular expression implements such a check, it is easy to accidentally make the check too permissive by not escaping regular-expression meta-characters such as .. Even if the check is not used in a security-critical context, the incomplete check may still cause undesirable behavior when it accidentally succeeds. ```
This commit is contained in:
parent
34b2c347c9
commit
783979948d
|
|
@ -20,7 +20,7 @@ const (
|
||||||
// RootDir is the path to the root directory
|
// RootDir is the path to the root directory
|
||||||
RootDir = "/"
|
RootDir = "/"
|
||||||
|
|
||||||
//KanikoDir is the path to the Kaniko directory
|
// KanikoDir is the path to the Kaniko directory
|
||||||
KanikoDir = "/kaniko"
|
KanikoDir = "/kaniko"
|
||||||
|
|
||||||
IgnoreListPath = "/proc/self/mountinfo"
|
IgnoreListPath = "/proc/self/mountinfo"
|
||||||
|
|
@ -76,8 +76,9 @@ const (
|
||||||
var ScratchEnvVars = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
|
var ScratchEnvVars = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
|
||||||
|
|
||||||
// AzureBlobStorageHostRegEx is ReqEX for Valid azure blob storage host suffix in url for AzureCloud, AzureChinaCloud, AzureGermanCloud and AzureUSGovernment
|
// AzureBlobStorageHostRegEx is ReqEX for Valid azure blob storage host suffix in url for AzureCloud, AzureChinaCloud, AzureGermanCloud and AzureUSGovernment
|
||||||
var AzureBlobStorageHostRegEx = []string{"https://(.+?).blob.core.windows.net/(.+)",
|
var AzureBlobStorageHostRegEx = []string{
|
||||||
"https://(.+?).blob.core.chinacloudapi.cn/(.+)",
|
"https://(.+?)\\.blob\\.core\\.windows\\.net/(.+)",
|
||||||
"https://(.+?).blob.core.cloudapi.de/(.+)",
|
"https://(.+?)\\.blob\\.core\\.chinacloudapi\\.cn/(.+)",
|
||||||
"https://(.+?).blob.core.usgovcloudapi.net/(.+)",
|
"https://(.+?)\\.blob\\.core\\.cloudapi\\.de/(.+)",
|
||||||
|
"https://(.+?)\\.blob\\.core\\.usgovcloudapi\\.net/(.+)",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue