Restrict livecheck redirects#22944
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens brew livecheck network safety by preventing redirect chains from downgrading to non-HTTPS targets, and ensures the same redirect policy is applied consistently across both header and content fetching paths.
Changes:
- Add HTTPS-only redirect restrictions to livecheck’s curl invocations (via
--proto-redir =https) and centralize redirect-related args. - Keep
page_headersandpage_contentaligned by reusing the same redirection argument set. - Add focused specs to prevent regressions in redirect protocol guarding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/livecheck/strategy.rb | Introduces shared redirect curl args and applies HTTPS-only redirect policy to livecheck fetches. |
| Library/Homebrew/test/livecheck/strategy_spec.rb | Adds regression tests asserting HTTPS-only redirect args are used for both header and content fetches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Prevent `brew livecheck` from following upstream redirects to non-HTTPS targets by default. - Reuse `Utils::Curl` redirect protocol args so the HTTPS-only policy remains single-source. - Cover the redirect protocol guard with focused regressions.
0b5ddc5 to
dd4ce45
Compare
p-linnane
approved these changes
Jul 4, 2026
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.
brew livecheckfrom following upstream redirects to non-HTTPS targets by default.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review and testing.