Skip to content

fix(plugin_model): prevent OS command injection via pypi_url setting#3489

Open
jmthomas wants to merge 1 commit into
mainfrom
pypi_url
Open

fix(plugin_model): prevent OS command injection via pypi_url setting#3489
jmthomas wants to merge 1 commit into
mainfrom
pypi_url

Conversation

@jmthomas

Copy link
Copy Markdown
Member

PluginModel.install_phase2 interpolated the user-writable pypi_url setting into a shell command run through a backtick, allowing arbitrary OS command execution during plugin install. Run pipinstall via an argv array with Open3.capture2e (no shell) and validate pypi_url is an http(s) URL at use-time, falling back to the default on a bad value. Add a shared PypiUrl utility and spec.

🤖 Generated with Claude Code

PluginModel.install_phase2 interpolated the user-writable pypi_url
setting into a shell command run through a backtick, allowing arbitrary
OS command execution during plugin install. Run pipinstall via an argv
array with Open3.capture2e (no shell) and validate pypi_url is an
http(s) URL at use-time, falling back to the default on a bad value.
Add a shared PypiUrl utility and spec.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@jmthomas jmthomas requested review from mcosgriff and ryanmelt June 18, 2026 14:06
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.23%. Comparing base (f29c725) to head (be70d1d).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
openc3/lib/openc3/models/plugin_model.rb 20.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3489      +/-   ##
==========================================
- Coverage   79.25%   79.23%   -0.02%     
==========================================
  Files         689      690       +1     
  Lines       57293    57306      +13     
  Branches      728      728              
==========================================
+ Hits        45406    45408       +2     
- Misses      11809    11820      +11     
  Partials       78       78              
Flag Coverage Δ
python 80.28% <ø> (ø)
ruby-api 81.06% <ø> (-0.27%) ⬇️
ruby-backend 83.10% <63.63%> (+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.

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

Tests pass locally, looks good

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.

2 participants