Fix command injection in publish.js senso invocations#1
Closed
wd7zfpysvs-ui wants to merge 1 commit into
Closed
Conversation
Switch from execSync with interpolated shell strings to execFileSync with argv arrays. JSON.stringify does not escape single quotes, so untrusted search-result content reaching publishReceipt could break out of the shell-quoted --data argument and execute arbitrary commands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by #2, which landed first on main with an equivalent (and more thorough) fix: spawnSync with argv array, plus error handling and other hardening. Closing as no-op. |
This was referenced May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publish.jsfromexecSyncwith interpolated shell strings toexecFileSyncwith argv arrays so thesensoCLI's--datapayload is passed as a single argument and never re-parsed by a shell.JSON.stringifydoes not escape single quotes, so untrusted third-party content reachingpublishReceipt(search-result titles/URLs/descriptions from Nimble, embedded inraw_markdown) could break out of the shell-quoted--datablock and execute arbitrary commands as the agent user — full RCE with access toWALLET_PRIVATE_KEYand all API keys.Test plan
senso engine publish.prompts createcall returns aprompt_idas before.'ends up in the published markdown.🤖 Generated with Claude Code