Enable Hex dependency cooldown - #4971
Open
stuartc wants to merge 3 commits into
Open
Conversation
Adds hex: [cooldown: "1w"] to mix.exs so newly-resolved dependency versions must have existed for at least a week before Hex will pull them in, mitigating supply-chain attacks that get caught and retired within days. Normal builds against an intact mix.lock are unaffected. Older Hex silently ignores the cooldown config, so bin/bootstrap now enforces Hex >= 2.5.0, auto-upgrading and failing fast if it can't.
stuartc
marked this pull request as ready for review
July 14, 2026 18:47
Security Review ✅
|
Fixes a pre-existing Credo --strict refactoring finding that was failing the lint CI job.
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.
Description
This PR adds Hex 2.5.0's dependency release-age cooldown to Lightning.
Setting
hex: [cooldown: "1w"]inmix.exsmeans Hex won't resolve to a package version until it has existed for at least a week. This mitigates the common supply-chain attack where a compromised release is pulled into builds before anyone notices and retires it — most such incidents are caught within days. Lightning only consumes dependencies (it doesn't publish), so this only affects what we pull in, never what we ship.Day-to-day impact is basically nil:
mix deps.getagainst an intactmix.lockbypasses the cooldown entirely, so normal builds and CI are unchanged. The cooldown only bites when resolving something new (mix deps.update, adding a dep, ordeps.getafter unlocking). Security fixes for a dep we're already locked to re-resolve past the cooldown automatically; a genuinely urgent fresh fix can be forced for a single command withHEX_COOLDOWN=0d mix deps.update <pkg>.The catch: Hex older than 2.5.0 silently ignores the config, giving false confidence. So:
bin/bootstrapnow enforces Hex>= 2.5.0for local dev, auto-upgrading and failing fast if it can't.mix local.hex --force, so it's covered.Validation steps
< 2.5.0, runbin/bootstrapand confirm it upgrades Hex and reports>= 2.5.0.>= 2.5.0, runmix deps.getagainst the committedmix.lockand confirm it resolves unchanged (cooldown does not bite locked versions).mix hex.outdatedand confirm any versions inside the 1-week window are annotated(cooldown).Additional notes for the reviewer
1w— covers all-but-one of the analysed supply-chain incidents while costing us almost nothing for an app that doesn't ship on every dependency bump.ensure_hex_versioninbin/bootstrap.d/common.shusessort -Vso it treats e.g. 2.10 as newer than 2.5.AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)