Skip to content

Allow hackney 4.x - #3

Merged
janwillemvd merged 1 commit into
masterfrom
janwillemvd/relax-hackney-constraint
Aug 9, 2026
Merged

janwillemvd merged 1 commit into
masterfrom
janwillemvd/relax-hackney-constraint

Conversation

@janwillemvd

Copy link
Copy Markdown

excontainers only reaches hackney through Tesla.Adapter.Hackney and makes no direct :hackney.* calls, so it can follow Tesla's own supported range instead of pinning ~> 1.16.

That pin was the last thing holding qdentity/mindfields-phx on hackney 1.25.0, which carries four advisories — all first patched in 4.0.1:

Advisory Severity
GHSA-gp9c-pm5m-5cxr — ssl:connect/2 post-handshake upgrade has no timeout high
GHSA-j9wq-vxxc-94wf — CR/LF injection in query parameter moderate
GHSA-pj7v-xfvx-wmjq — SSRF allowlist bypass via percent-encoded host moderate
GHSA-mp55-p8c9-rfw2 — CRLF / header injection via domain/path low

The new requirement mirrors Tesla's: hackney 2.x, 3.x, 4.0.0 and 4.0.1 are excluded because they lack exports Tesla relies on.

Follows the same pattern as #1 (relax tesla) and #2 (allow gestalt 2.x).

excontainers only reaches hackney through Tesla.Adapter.Hackney and makes no
direct :hackney calls, so it can follow Tesla's supported range. Pinning to
~> 1.16 was holding consumers on hackney 1.x, which carries four unpatched
advisories (GHSA-gp9c-pm5m-5cxr high, GHSA-j9wq-vxxc-94wf, GHSA-mp55-p8c9-rfw2,
GHSA-pj7v-xfvx-wmjq), all first patched in 4.0.1.
@janwillemvd janwillemvd self-assigned this Aug 9, 2026
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Required label not found on this PR.

@janwillemvd
janwillemvd merged commit efe8e34 into master Aug 9, 2026
1 of 2 checks passed
@janwillemvd
janwillemvd deleted the janwillemvd/relax-hackney-constraint branch August 9, 2026 07:46
@janwillemvd

Copy link
Copy Markdown
Author

Heads-up: relaxing the constraint is correct in principle, but hackney 4.x cannot actually be used by excontainers yet — 4.7.2 broke unix-domain-socket connections, which is exactly how we reach the Docker daemon.

http+unix:// URLs still parse correctly (transport: hackney_local_tcp, host: ~c"/var/run/docker.sock", port: 0) and hackney_local_tcp.erl is byte-identical to 1.25.0, but the connection attempt in 4.x's rewritten conn layer routes through hackney_happy (happy-eyeballs DNS) instead of dispatching to the local_tcp transport:

hackney :hackney.request(:get, "http+unix://%2Fvar%2Frun%2Fdocker.sock/v1.41/version", [], "", [])
1.25.0 {:error, :enoent} (tried the socket)
4.7.2 {:error, :nxdomain} (tried DNS)

In qdentity/mindfields-phx this makes Excontainers.Container.init/1 fail and takes out every test using PostgresContainer (qdentity/mindfields-phx#4587 was dequeued by the merge queue over it).

So this widened requirement lets the solver pick a hackney that does not work here. Worth either reverting until upstream restores unix-socket support, or keeping it with a comment that 4.x is currently unusable for the Docker transport.

janwillemvd added a commit that referenced this pull request Aug 9, 2026
#3 widened this to allow hackney 4.x on the reasoning that we only reach
hackney through Tesla.Adapter.Hackney and make no direct :hackney calls. That
missed that we reach the Docker daemon over a unix domain socket, which
hackney 4.x can no longer connect to.

The URL still parses correctly in 4.7.2 (transport hackney_local_tcp, host
/var/run/docker.sock, port 0) and hackney_local_tcp.erl is byte-identical to
1.25.0, but 4.x's rewritten connection layer routes through hackney_happy
(happy-eyeballs DNS) and never dispatches the local_tcp transport:

  :hackney.request(:get, "http+unix://%2Fvar%2Frun%2Fdocker.sock/v1.41/version", [], "", [])
  1.25.0 => {:error, :enoent}    (tried the socket)
  4.7.2  => {:error, :nxdomain}  (tried DNS)

Downstream this made Excontainers.Container.init/1 fail and took out every
test using a container (qdentity/mindfields-phx#4587 was dequeued over it).

Restores the cap and documents why, so it isn't widened again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant