Skip to content

Commit c014416

Browse files
committed
Address all characters that require quoting
1 parent f62056f commit c014416

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/state-exec/cmd_windows.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func appendEscapeArg(b []byte, s string) []byte {
4444
switch s[i] {
4545
case '"', '\\':
4646
needsBackslash = true
47-
case ' ', '\t', '<', '>':
47+
// Based on https://github.com/sebres/PoC/blob/master/SB-0D-001-win-exec/SOLUTION.md#definition
48+
case ' ', '\t', '<', '>', '&', '|', '^', '!', '(', ')', '%':
4849
needsQuotes = true
4950
}
5051
}

internal/osutils/exeutils_windows.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ func appendEscapeArg(b []byte, s string) []byte {
5757
switch s[i] {
5858
case '"', '\\':
5959
needsBackslash = true
60-
case ' ', '\t', '<', '>':
60+
// Based on https://github.com/sebres/PoC/blob/master/SB-0D-001-win-exec/SOLUTION.md#definition
61+
case ' ', '\t', '<', '>', '&', '|', '^', '!', '(', ')', '%':
6162
needsQuotes = true
6263
}
6364
}

0 commit comments

Comments
 (0)