Repository navigation
[MEDIUM] Harden RubyGems publication inputs - #63
Open
OskarEichler wants to merge 1 commit into
Open
OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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
This hardens the RubyGems publication boundary in two focused ways:
The release job keeps its existing
bundle exec rake releaseflow.Gemfile.releasecontains only the local gemspec, Rake, and RSpec because the Rakefile loads both libraries before defining the release task.Security impact
The current release job grants
contents: writeandid-token: writeto the whole job. It then executes three actions through mutable major tags and performs Bundler resolution from a Gemfile that followslostisland/faraday's default branch without a lockfile. A compromised action tag or allowed dependency source could therefore affect the release workspace or package while publication authority is available.The patch binds the action code to these reviewed releases:
actions/checkoutv7.0.1ruby/setup-rubyv1.321.0rubygems/release-gemv1.4.1The release bundle resolves 10 gems including the local package; every remote gem has a SHA-256 checksum in
Gemfile.release.lock.Verification
bundle checkon both Rubiesbundle exec rake buildproduced the gem on both Rubiesnet-http ~> 0.5git diff --checkpassedNo tests were added or modified.
Limitations
I did not run an actual RubyGems OIDC publication or inspect repository-level branch, environment, and trusted-publisher settings. The existing release action still requires
contents: writebecause its release task pushes the version tag.Breaking changes
No runtime or package-contract breaking changes. Release maintenance now requires explicit lockfile refreshes when build dependencies are updated; the release workflow uses the checked-in Bundler 4 lock with its existing Ruby 3.4.4 toolchain.