Skip to content

fix(deps): bump hackney to 4.x to address security advisories#104

Open
jtippett wants to merge 1 commit into
workos:mainfrom
jtippett:fix/hackney-cve-bump
Open

fix(deps): bump hackney to 4.x to address security advisories#104
jtippett wants to merge 1 commit into
workos:mainfrom
jtippett:fix/hackney-cve-bump

Conversation

@jtippett

Copy link
Copy Markdown

Summary

hackney releases <= 4.0.1 are affected by a batch of security advisories fixed in hackney 4.0.2+, including:

There is no 1.x backport, so the previous {:hackney, "~> 1.9"} constraint could only ever resolve to vulnerable releases (the lockfile sat at 1.20.1).

Changes

  • Widen the hackney constraint to ~> 1.21 or ~> 4.0 and >= 4.0.2, mirroring Tesla's own hackney adapter constraint. This keeps backward compatibility for downstream consumers still on hackney 1.x while allowing (and, on a fresh resolve, preferring) the patched 4.x line.
  • Update mix.lock so it resolves to hackney 4.4.5.
  • Bump tesla 1.8.0 → 1.20.0: older Tesla capped its optional hackney dependency at ~> 1.6, which blocked 4.x resolution. Recent Tesla declares ~> 1.21 or ~> 4.0 and >= 4.0.2 and its hackney adapter supports the 4.x API.

Why this is low-risk

  • The SDK uses hackney only as the default Tesla adapter — it never calls hackney directly — so the major bump is absorbed by Tesla's adapter.
  • The test suite runs against Tesla.Mock, so hackney isn't exercised in tests.

Verification

  • MIX_ENV=prod mix compile --force — clean compile with hackney 4.4.5 + tesla 1.20.0.
  • mix test113 passed.
  • mix hex.audit — no retired packages.

hackney <= 4.0.1 is affected by a batch of advisories fixed in 4.0.2+
(e.g. CVE-2026-47075 CRLF injection / HTTP request splitting,
CVE-2026-47066 infinite loop, CVE-2026-47070, CVE-2026-47077). There is
no 1.x backport, so the previous `~> 1.9` constraint could only resolve
to vulnerable releases.

Widen the constraint to `~> 1.21 or ~> 4.0 and >= 4.0.2`, mirroring
Tesla's own hackney adapter constraint, and update the lock so it
resolves to hackney 4.4.5. Tesla is bumped 1.8.0 -> 1.20.0 because older
Tesla capped its optional hackney dependency at `~> 1.6`, which blocked
4.x resolution.

workos uses hackney only as the default Tesla adapter (never directly),
and the test suite runs against Tesla.Mock, so the major bump is
absorbed by Tesla's adapter. Full suite passes (113 tests).
@jtippett jtippett requested a review from a team as a code owner June 28, 2026 11:16
@greptile-apps

greptile-apps Bot commented Jun 28, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the HTTP dependency set used by the SDK. The main changes are:

  • Widened the direct hackney constraint to allow patched 4.x releases while keeping a compatible 1.x path.
  • Updated mix.lock to resolve hackney to 4.4.5.
  • Updated tesla and related transitive dependencies needed for the new hackney resolution.

Confidence Score: 5/5

The dependency-only changes are merge-safe based on the provided compile, test, and audit verification.

The changed files are limited to dependency constraints and lockfile updates, and the described verification covers compilation, the test suite, and package audit results.

T-Rex T-Rex Logs

What T-Rex did

  • Compared before/after lockfile versions and constraints during dependency resolution and verified the downstream hackney compatibility checks; the scripts used to generate these captures are saved for review.
  • Compared base dependency versions for hackney and tesla; observed that compile/test/audit could not run in this environment, so the PR claim remains unverified.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(deps): bump hackney to 4.x to addres..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd57e85968

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mix.lock
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"h2": {:hex, :h2, "0.10.2", "ea0146b9c8b5f3b5de16045765f5684db38ef1e66f1c60444890948cb1003e47", [:rebar3], [], "hexpm", "497a899f338b42e6a0b292524e635b0ce6f9379fa39395c8e38d06351cd9b9cf"},
"hackney": {:hex, :hackney, "4.4.5", "a908f620525bb886a16613532324762e5166287f8c00c9888a762edee11a30c0", [:rebar3], [{:certifi, "~> 2.17.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:h2, "~> 0.10.1", [hex: :h2, repo: "hexpm", optional: false]}, {:idna, "~> 7.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.2", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:quic, "~> 1.6.5", [hex: :quic, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:webtransport, "~> 0.4.1", [hex: :webtransport, repo: "hexpm", optional: false]}], "hexpm", "6d72bef4e135e94c522c271e11fbb6933efb0006ef235a3933807d0be73b71ec"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid pulling quic into OTP 25 builds

The CI matrix still includes an OTP 25.3 job (.github/workflows/main.yml:30-31) and that job runs mix do deps.get, deps.compile (.github/workflows/main.yml:57-59), but this lock entry makes quic a non-optional transitive dependency of hackney 4.4.5. quic 1.6.x declares {minimum_otp_vsn, "26"}, so the OTP 25 job and users on that still-supported runtime will fail during dependency compilation even though mix.exs still advertises broad Elixir support. Please either drop OTP 25 support or avoid resolving a hackney version that pulls this OTP 26-only dependency for supported builds.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant