Skip to content

Harden HOPE Julia subprocess argument handling - #130

Merged
qian-harvard merged 1 commit into
Power-Agent:mainfrom
swang22:security/harden-hope-julia-args
Oct 19, 2026
Merged

qian-harvard merged 1 commit into
Power-Agent:mainfrom
swang22:security/harden-hope-julia-args

Conversation

@swang22

@swang22 swang22 commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

  • Validate the final resolved solver against the existing _SOLVER_OPTIONS allow-list in both hope_debug_solver_environment and hope_debug_solver_environment_async.
  • Escape Julia $ interpolation in julia_string_literal.
  • As additional defense-in-depth, pass caller-controlled solver names and case paths through Julia ARGS instead of embedding them in -e source, including the normal run, holistic, and EREC launch paths.
  • Add regression coverage for explicit and settings-derived invalid solvers, both debug launch modes, argument separation, and literal $ handling.

Validation

  • 31 upstream HOPE tests pass locally.
  • A real HiGHS Julia environment probe completes with PROBE_STATUS=ok and HiGHS.Optimizer.
  • All PowerMCP CI checks pass on Python 3.10, 3.12, 3.13, and 3.14, including the PowerFactory wheel smoke test.

Responsibly reported by @hexisteme. This implements both remediations proposed by the reporter, with the additional ARGS separation above. Reporter review is welcome before release.

The GitHub Security Advisory, reporter collaborator/credit, and CVE request should be coordinated separately by a PowerMCP repository maintainer.

Validate debug solver selection, pass caller-controlled values through Julia ARGS, and add regression coverage.

Responsibly reported by @hexisteme.
@swang22

swang22 commented Oct 18, 2026

Copy link
Copy Markdown
Author

@hexisteme Thank you for the proposed remediation. This PR implements both requested changes and adds argument-based separation as defense-in-depth. All local and upstream CI tests pass. Your review would be appreciated before release.

@hexisteme

Copy link
Copy Markdown

Reviewed — looks good to me, thanks for the fast and thorough fix.

It fully addresses the reported issue and goes further than I proposed: the _SOLVER_OPTIONS allow-list is now enforced in both hope_debug_solver_environment and the async variant (nice catch rejecting empty strings via is not None); julia_string_literal escapes $, closing interpolation at every call site; and passing case_path/solver through Julia ARGS instead of generated source is the right structural fix — it removes the injection class rather than filtering it. Regression tests for both the sync and async paths are present.

I also checked hope_run_erec: overrides_str only interpolates voll_override/delta_mw (typed float | None) and case_path now goes through the hardened literal, so I don't see a residual injection vector there.

LGTM to release. One request for the security side: could you publish a GitHub Security Advisory for this and request a CVE from the draft (GitHub is a CNA), crediting me (@hexisteme) as reporter? Happy to be added to the advisory draft if you enable Private Vulnerability Reporting. Thanks again!

@qian-harvard qian-harvard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and verified locally: the HOPE suite passes, and a real Julia run confirms that values passed through ARGS (including $(run(...))) arrive as literal text. Thanks @swang22 for the fix and @hexisteme for the report and review. This ships as 0.4.1, and advisory GHSA-6mvp-cq74-hhf5 is in draft.

@qian-harvard
qian-harvard merged commit 6a00b85 into Power-Agent:main Oct 19, 2026
5 checks passed
BurhanAbdullah pushed a commit to BurhanAbdullah/PowerMCP that referenced this pull request Oct 23, 2026
Patch release carrying only the HOPE Julia code-injection fix (Power-Agent#130)
on top of 0.4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants