Skip to content

fix(http): replace HTTPoison transport with Req - #9

Open
iautom8things wants to merge 2 commits into
mainfrom
fix/uasgard-7n0-req-transport
Open

iautom8things wants to merge 2 commits into
mainfrom
fix/uasgard-7n0-req-transport

Conversation

@iautom8things

@iautom8things iautom8things commented Sep 12, 2026

Copy link
Copy Markdown
Member

The Asgard strategy keeps HTTPoison and Hackney in consumer dependency graphs. Replace its token and JWKS transport with patched Req 0.7.4 while retaining existing authentication flows.

The client preserves Basic and form credentials, callback URI and PKCE verifier, nonce and RS256 verification, refresh-token retention, scopes and explicit legacy callbacks. Requests disable retries, redirects and decompression, retain finite connection/pool/receive timeouts, and return bounded errors without provider bodies or credentials. Request-local Finch options work when a host application configures a global named Finch pool, without changing that host pool or its defaults. Elixir 1.15 remains the minimum.

The initial 0.5.18 constraint excluded the fix for GHSA-655f-mp8p-96gv. The corrected lock changes only Req; Finch stays 0.22.0. Before the transport correction, three real Atlas-default tests reproduced the named-Finch conflict. They now pass.

The full 22-test suite, forced checked compilation and formatting passed. Independent correction review reran all 22 tests with zero failures and checked the running Req/Finch versions and absence of HTTPoison/Hackney. Real local HTTP covers reserved-character credentials, uncached JWKS during complete code callback, legacy callbacks, exact retry/redirect refusal, malformed responses, finite receive timeout, host-pool preservation and safe refusal of small compressed responses. Prior audits apply to the original transport implementation; the correction has its own independent evidence.

Atlas and Argos consumer tests, complete consumer dependency audits, release boot and deployed login verification remain required before consumer release. This PR proposes an immutable Git revision and does not publish a Hex package. The repository has no CI workflow or VERSION/CHANGELOG release convention, so its existing package version is retained.

Tracks Asgard transport remediation.

@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

The PR is not yet safe to merge because its new production transport is constrained to a Req release with a reachable response-decompression denial-of-service vulnerability.

Summary

  • Preserves Basic and form-based client authentication, PKCE, callback URI, token fields, scopes, and legacy ID-token callbacks.
  • Disables automatic retries and redirects and introduces capped connection and receive timeouts.
  • Sanitizes provider errors and validates token and JWKS response shapes.
  • Removes HTTPoison and Hackney from the dependency graph, but currently constrains Req to a release with a reachable decompression-denial-of-service vulnerability.

Diagram

sequenceDiagram
  participant App as Ueberauth application
  participant Client as Asgard Client
  participant Req as Req / Finch
  participant Provider as Asgard provider
  App->>Client: Exchange authorization code
  Client->>Req: POST /token (no retry or redirect)
  Req->>Provider: Form-encoded token request
  Provider-->>Req: JSON response
  Req-->>Client: Decompress and return body
  Client-->>App: Tokens or bounded error
  App->>Client: Verify ID token on cache miss
  Client->>Req: GET /certificates
  Req->>Provider: JWKS request
  Provider-->>Req: JSON JWKS response
  Req-->>Client: Decompress and return body
  Client-->>App: Selected signing key or bounded error
Loading

Reviews (1) · Last reviewed commit: "fix: replace Asgard HTTPoison transport ..."

Comment thread mix.exs Outdated
{:ueberauth, "~> 0.10.8"},
{:jose, "~> 1.8"},
{:httpoison, "~> 1.6"},
{:req, "~> 0.5.0"},

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 security Vulnerable Req Version Pinned

The new ~> 0.5.0 constraint excludes the fixed Req 0.6.1 release, and the lock file resolves Req 0.5.18. Although the client sets decode_body: false, that does not disable this version's content-encoding decompression step. A malicious token or JWKS response with nested compression layers can therefore consume unbounded memory and take down the application. Upgrade to a fixed Req release or explicitly disable response decompression with the supported raw-response option.

How this was verified: Both reachable provider-response paths use Req 0.5.18 without raw mode, leaving its content-encoding decompression step active.

Knowledge Base Used: Asgard API client behavior

Fix in Claude Code

iautom8things pushed a commit that referenced this pull request Sep 17, 2026
…ession: 01a094f3-eeeb-7f43-afc7-1f8a2448423e\nLog: /Users/mz/.codex-remembers/sessions/2026/09/12/rollout-2026-09-12T05-30-09-01a094f3-eeeb-7f43-afc7-1f8a2448423e.jsonl\n\nhttps://github.com//pull/9 proposes exact 25c4dc4. Remote main remains ca49ce3; rebase was clean and unchanged. Cold verification and separate audit approve the exact candidate, including 20 real HTTP/auth tests, checked compile/format, actual dependency and runtime exclusion of HTTPoison/Hackney. Reports /tmp/uasgard-7n0-cold-verification.md and /tmp/uasgard-7n0-audit.md.\n\nThis repository has no CI workflow or VERSION/CHANGELOG convention. Root follows its existing Git dependency workflow and retains the package version. No Hex publication, merge or deployment occurred. Atlas/Argos immutable-pin consumer integration, complete consumer gates and deployed login evidence remain required. PR is open, ticket stays in progress."
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