github-code-scanning[bot] commented on code in PR #7562: URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1221714674
########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/271) ########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/269) ########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/272) ########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/273) ########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/274) ########## experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts: ########## @@ -37,17 +37,17 @@ /** * A regular expression that matches character strings that are illegal in `xml_id`s */ -const XML_ID_SANITIZE = /[^a-z0-9\-]+/g; +const XML_ID_SANITIZE = /[^a-z0-9-]+/g; /** * A regular expression that matches a valid xml_id */ -const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/; +const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/; /** * A regular expression that matches a valid hostname */ -const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/; +const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/; Review Comment: ## Overly permissive regular expression range Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\]. [Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/270) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
