Skip to content

fix Windows execd: neutralize cmd.exe metacharacters in AR args - #2367

Merged
atomicturtle merged 1 commit into
ossec:mainfrom
atomicturtle:fix/ant-2026-rykb1oli-win-execd-cmd-injection
Oct 20, 2026
Merged

atomicturtle merged 1 commit into
ossec:mainfrom
atomicturtle:fix/ant-2026-rykb1oli-win-execd-cmd-injection

Conversation

@atomicturtle

Copy link
Copy Markdown
Member

WinExecdRun builds a quoted CreateProcess command line for .cmd active responses. An enrolled agent can put a double quote in the event location; cmd.exe then treats following "&…&" as a separate command and runs it as LocalSystem on other Windows agents with AR enabled.

Sanitize user, IP, and the request remainder (including location) with OS_WinExecdCleanArg before both the add and timeout-delete lines are built: replace '"', '%', and control characters with '_'. Add issue_win_execd_cmd_injection regression.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-RYKB1OLI.

WinExecdRun builds a quoted CreateProcess command line for .cmd active
responses. An enrolled agent can put a double quote in the event location;
cmd.exe then treats following "&…&" as a separate command and runs it as
LocalSystem on other Windows agents with AR enabled.

Sanitize user, IP, and the request remainder (including location) with
OS_WinExecdCleanArg before both the add and timeout-delete lines are built:
replace '"', '%', and control characters with '_'. Add
issue_win_execd_cmd_injection regression.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-RYKB1OLI.

Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
@atomicturtle
atomicturtle merged commit 7b9f0a8 into ossec:main Oct 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant