Override hackney to 4.x to clear 1.x security advisories - #60
Closed
clairenlin wants to merge 1 commit into
Closed
Conversation
instream hard-pins hackney "~> 1.1", whose 1.x line carries four open advisories (handshake-timeout, CR/LF query injection, header injection, SSRF allowlist bypass) fixed only in 4.x. Override to hackney "~> 4.0" (drop-in for the request/5 + body/1 API instream uses), drop the --ignore-package-names hackney workaround, and document that consuming apps must repeat the top-level override since Mix ignores :override in nested deps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What & why
Every application depending on zexbox is being flagged for hackney security advisories. This fixes the root cause.
Root cause: zexbox →
instream(2.2.1, latest, released 2023) →hackney. instream hard-depends on{:hackney, "~> 1.1", optional: false}, so hackney is always compiled in and pinned to the 1.x line. hackney 1.25.0 carries four open advisories, all fixed only in 4.0.1+:ssl:connect/2post-handshake upgrade has no timeoutdomain/pathWhy all consumers see it: zexbox's
auditalias silenced this locally with--ignore-package-names hackney, but that flag only applies to zexbox's ownmix auditrun. Downstream apps run their own audits / Dependabot, which don't inherit the flag — so vulnerable hackney 1.25.0 lights up everywhere.Fix
Override to a patched
hackney "~> 4.0"(resolves to 4.6.0). 4.x is a documented drop-in for therequest/5+body/1API instream uses; it also bumps cowlib/gun so the raw audit is now completely clean. The--ignore-package-names hackneyworkaround is removed.Mix ignores
:overridein nested dependencies — it's only honoured in the top-level project. So this override fixes zexbox's own CI but does not transitively fix consuming apps. Each consuming app must add to its owndeps:Once this ships, apps still on the old resolution will hit a dependency-divergence error on
mix deps.get(instream's~> 1.1vs zexbox's~> 4.0) until they add the override. That's a deliberate, loud forcing function for a security fix — flagging it here so the rollout can be coordinated. README + CHANGELOG document it.Verification
mix deps.get→ hackney 4.6.0mix compile→ clean (only pre-existing instream deprecation warning)mix audit→ No vulnerabilities foundmix test→ 34 tests, 0 failures🤖 Generated with Claude Code