Skip to content

fix(script-runner): validate suiteRunner values as identifiers - #3755

Open
jmthomas wants to merge 3 commits into
mainfrom
fix-suite-runner-injection
Open

fix(script-runner): validate suiteRunner values as identifiers#3755
jmthomas wants to merge 3 commits into
mainfrom
fix-suite-runner-injection

Conversation

@jmthomas

Copy link
Copy Markdown
Member

The suite, group, script, and method values are interpolated into the Ruby/Python snippet the running script evaluates, so unvalidated input allowed arbitrary code execution and bypassed the script approval gate enforced in scripts_controller#run (CWE-94 / CWE-863).

Reject anything that isn't a bare class/method name in SuiteRunner build_options (both languages, covering the GUI and openc3cli paths) and at the controller so bad requests return 400 instead of starting a run.

🤖 Generated with Claude Code

The suite, group, script, and method values are interpolated into the
Ruby/Python snippet the running script evaluates, so unvalidated input
allowed arbitrary code execution and bypassed the script approval gate
enforced in scripts_controller#run (CWE-94 / CWE-863).

Reject anything that isn't a bare class/method name in SuiteRunner
build_options (both languages, covering the GUI and openc3cli paths) and
at the controller so bad requests return 400 instead of starting a run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jmthomas
jmthomas requested a balanced review from Copilot August 21, 2026 14:48

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.16%. Comparing base (53caa5c) to head (f752a71).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3755      +/-   ##
==========================================
+ Coverage   79.15%   79.16%   +0.01%     
==========================================
  Files         894      894              
  Lines       66866    66916      +50     
  Branches     2552     2600      +48     
==========================================
+ Hits        52925    52976      +51     
+ Misses      13280    13276       -4     
- Partials      661      664       +3     
Flag Coverage Δ
frontend 66.09% <ø> (+<0.01%) ⬆️
python 79.29% <ø> (+0.01%) ⬆️
ruby-api 82.13% <100.00%> (+0.08%) ⬆️
ruby-backend 84.47% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clayandgen clayandgen 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.

I guess it finds nested ifs as a major code smell... logic looks good, will approve once that's resolved

Comment thread openc3/lib/openc3/script/suite_runner.rb Outdated
@sonarqubecloud

Copy link
Copy Markdown

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.

4 participants