Repository navigation
Fix Sonar path-injection findings - #14
Merged
Merged
Conversation
chrisknvidia
added a commit
that referenced
this pull request
Oct 1, 2026
The Hermes launch regex could split each `--x` token two ways, so a long run of flags backtracked exponentially (CodeQL py/redos alert #14). It ran on every command before the launch, including Harbor's MCP heredoc, where a plugin MCP URL is plugin text. 40 repeated flags hung the run inside Harbor's event loop. The Claude Code, Codex, and OpenCode patterns had the same scoping problem: task MCP args with `claude --verbose` (or `codex exec`, `opencode --model=`) took the one-shot setup and `--plugin-dir`, and the real launch then ran without the plugin, silently. Now each wrapper only rewrites Harbor's launch command: the launcher (the text before ` -- `) must be one line, the pattern is anchored at a shell-command boundary, and the flag tokens match one way only. Claude Code also needs Harbor's `--print` launch shape. A run whose launch never appears, or that shows a second launch, raises NativeLaunchError instead of running the with-plugin arm without the plugin. Tests run Harbor's real run() for all four agents with a recording fake environment and hostile task MCP text, and time the CodeQL input shape and a plugin MCP URL payload in a child process. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Christopher Kevin <[email protected]> (cherry picked from commit 685aaf54f4f1caa528937477e55a0a8e45ab4bf2)
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
Why
The first real Sonar analysis of main reported two
pythonsecurity:S2083findings:src/skillevaluator/tier3/harbor/local_agents.pysrc/skillevaluator/tier3/harbor/adapter.pyThe changes narrow the path trust boundaries without changing remote credential filenames or staged Dockerfile behavior.
Verification
OK[]The first Python 3.13 CI attempt hit the known timing-sensitive bridge worker assertion. Its complete job rerun passed.