Skip to content

Commit 6a88be6

Browse files
authored
Update powershell sanitizer regex (#1199)
* Updated regex to allow more characters Copy of microsoft/azure-pipelines-tasks#19028 * Bump extension and tasks versions
1 parent 70c2754 commit 6a88be6

28 files changed

+114
-26
lines changed

Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"version": {
88
"Major": 1,
99
"Minor": 5,
10-
"Patch": 5
10+
"Patch": 6
1111
},
1212
"demands": [
1313
],

Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppDeploy/IISWebAppDeployV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 2,
1818
"Minor": 1,
19-
"Patch": 5
19+
"Patch": 6
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 1,
1818
"Minor": 4,
19-
"Patch": 5
19+
"Patch": 6
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 2,
1818
"Minor": 2,
19-
"Patch": 5
19+
"Patch": 6
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/Tasks/IISWebAppMgmt/IISWebAppMgmtV3/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 3,
1818
"Minor": 1,
19-
"Patch": 5
19+
"Patch": 6
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 1,
1818
"Minor": 4,
19-
"Patch": 6
19+
"Patch": 7
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/Tasks/SqlDacpacDeploy/SqlDacpacDeployV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 2,
1818
"Minor": 1,
19-
"Patch": 6
19+
"Patch": 7
2020
},
2121
"demands": [
2222
],

Extensions/IISWebAppDeploy/Src/vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"extensionId": "iiswebapp",
44
"name": "IIS Web App Deployment Using WinRM",
5-
"version": "1.6.7",
5+
"version": "1.6.8",
66
"publisher": "ms-vscs-rm",
77
"description": "Using WinRM connect to the host Computer, to deploy a Web project using Web Deploy or a SQL DB using sqlpackage.exe.",
88
"public": true,

TaskModules/powershell/Sanitizer/ArgumentsSanitizer.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function Get-SanitizedArguments([string]$inputArgs) {
6060

6161
# regex rule for removing symbols and telemetry.
6262
# '?<!`' - checking if before character no backtick. '([allowedchars])' - checking if character is allowed. Otherwise, replace to $removedSymbolSign
63-
$regex = '(?<!\\)([^a-zA-Z0-9\\ _''"\-=/:.])';
63+
$regex = '(?<!`)([^a-zA-Z0-9\\` _''"\-=\/:\.*,+~?%\n])';
6464

6565
# We're splitting by ``, removing all suspicious characters and then join
6666
$argsArr = $inputArgs -split $argsSplitSymbols;
@@ -71,8 +71,6 @@ function Get-SanitizedArguments([string]$inputArgs) {
7171
$matchesChunks += , $matches;
7272
$argsArr[$i] = $argsArr[$i] -replace $regex, $removedSymbolSign;
7373
}
74-
75-
$argsArr[$i] = $argsArr[$i] -replace $regex, $removedSymbolSign;
7674
}
7775

7876
$resultArgs = $argsArr -join $argsSplitSymbols;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

0 commit comments

Comments
 (0)