
sky5454andClaude Opus 4.7
cb5d33124c
fix(powershell): windows security enhancement, sec deny powershell encoding bypass via iex inje… (#2836)
* fix(powershell): sec deny powershell encoding bypass via iex injection.
* fix(exec): security guard bypass fixes for PowerShell/CMD encoding and path traversal
- Split deny patterns into defaultDenyPatterns (all platforms) and
windowsDenyPatterns (Windows-only) to avoid false positives
- Add PowerShell encoding bypass detection:
- [Text.Encoding] and [System.Text.Encoding] variants
- -EncodedCommand short forms (-e, -ec, -enc)
- .GetString([byte[]] with whitespace variations
- FromBase64String decoding
- PowerShell variable = [byte[](...) patterns
- Literal \uXXXX Unicode escape sequences
- Expand PowerShell ($env:VAR) and CMD (%VAR%) environment variables
before workspace path checking to prevent $env:USERPROFILE bypass
- Expand ~ to home directory on Windows
- Add .../.../ path traversal variant detection (blocks .../.../, ..../..../)
- Add symlink/junction resolution before workspace check
- Add Windows path normalization for ADS (file.txt:stream) and
extended-length paths (\?\)
- Add comprehensive tests for all new patterns
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(exec): fix -EncodedCommand regex and rename Windows tests with expanded payloads
- Fix -EncodedCommand regex to match all short forms: -e, -ec, -enc, -en
- Rename Windows-specific tests with TestWindows_ prefix for clarity:
- TestWindows_TildeBypassPrevented
- TestWindows_SymlinkBypassPrevented
- TestWindows_PowerShellEncodingBypass
- Expand test payloads:
- [Text.Encoding]: add UTF8 and Unicode variants
- -EncodedCommand: add -enc and -en forms
- Unicode escape: add multiple \uXXXX forms
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* ci: retest
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:28:03 +08:00
..
2026-05-12 23:23:26 +02:00
2026-04-28 16:19:59 +08:00
2026-05-14 09:50:47 +08:00
2026-05-12 23:12:37 +02:00
2026-04-27 13:17:25 +02:00
2026-04-27 13:17:25 +02:00
2026-04-15 22:23:47 +08:00
2026-04-15 22:23:17 +08:00
2026-04-28 12:54:28 +08:00
2026-04-17 14:16:18 +08:00
2026-04-17 13:44:31 +08:00
2026-04-28 12:54:28 +08:00
2026-04-17 13:44:31 +08:00
2026-05-14 09:50:47 +08:00
2026-04-17 13:44:31 +08:00
2026-03-29 14:06:19 +02:00
2026-04-17 13:44:31 +08:00
2026-05-08 09:18:14 +02:00
2026-05-08 09:18:14 +02:00
2026-05-12 23:12:37 +02:00
2026-05-08 09:18:14 +02:00
2026-03-29 14:06:19 +02:00
2026-03-25 21:02:49 +08:00
2026-03-25 21:02:49 +08:00
2026-03-25 21:02:49 +08:00
2026-04-17 13:44:31 +08:00
2026-05-12 18:06:47 +02:00
2026-02-18 02:01:29 +08:00
2026-02-18 02:01:29 +08:00
2026-05-18 10:28:03 +08:00
2026-03-25 21:02:49 +08:00
2026-05-18 10:28:03 +08:00
2026-03-29 14:06:19 +02:00
2026-03-29 14:06:19 +02:00
2026-05-07 13:16:30 +02:00
2026-05-07 13:16:30 +02:00
2026-03-29 14:06:19 +02:00
2026-04-15 21:27:13 +08:00
2026-03-25 21:02:49 +08:00
2026-03-25 21:02:49 +08:00
2026-04-01 21:32:10 +08:00
2026-03-29 14:06:19 +02:00
2026-03-24 18:35:56 +08:00