Skip to content

fix(runtime): pin OTP releases that drop credentials on cross-origin redirect - #1035

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/clever-heisenberg-q9qp32
Nov 9, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/clever-heisenberg-q9qp32

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Erlang/OTP releases before 27.3.4.13 make :httpc resend the authorization header to whatever host a redirect names. Hypatia pinned 27.3.4.4 in mise.toml and ran its test lanes on 27.0, and both are affected.

I measured this on 2026-11-09 with a local probe: five redirect codes (301, 302, 303, 307, 308), GET and POST, to another port and to another host. That is 20 cross-origin cases per release:

OTP Cross-origin cases that carried the header
27.0.1, 27.3.4.4, 27.3.4.12 20 of 20
27.3.4.13, 27.3.4.19, 28.5.0.8 0 of 20

The two echidnabot senders already set autoredirect: false (#1010). This change covers every other :httpc caller through the runtime pin.

Changes

  • mise.toml: erlang 27.3.4.4 → 27.3.4.19, the latest 27 patch.
  • tests.yml (three lanes) and merge-orchestrate.yml: otp-version 27.0 → 27.3.4.19, so the test lanes run the release that the runtime pins.
  • New test/httpc_redirect_credentials_test.exs:
    • 10 cross-origin redirect cases, each of which must not see the header;
    • a same-origin positive control, which must see it, so an empty result means the runtime dropped the header rather than the harness missing it.

Not changed

The 28.3 lanes in ci.yml and rsr-oracle.yml are deliberately kept identical to the estate dogfood gate. 28.3 also forwards the header (and 28.3.3 as well; 28.5.0.8 does not). Moving them needs a coordinated estate change across the dogfood gates and the standards reusable workflows; it is left to a separate decision.

Testing

  • On Elixir 1.17.3 with OTP 27.3.4.19, the full suite passes: 2699 tests, 0 failures, 246 excluded. The new test file passes: 11 tests.
  • On OTP 27.3.4.4, the new test fails all 10 cross-origin cases, and the same-origin control passes.
  • mix format --check-formatted is clean on the new file.

Generated by Claude Code

…redirect

Erlang/OTP before 27.3.4.13 makes :httpc resend the authorization header
to whatever host a redirect names. Measured on 2026-11-09 with a local
redirect probe (301/302/303/307/308, GET and POST, other port and other
host): 27.0.1, 27.3.4.4 and 27.3.4.12 forwarded it in all 20 cross-origin
cases; 27.3.4.13, 27.3.4.19 and 28.5.0.8 dropped it in all 20.

- mise.toml: erlang 27.3.4.4 -> 27.3.4.19 (latest 27 patch).
- tests.yml (3 lanes) and merge-orchestrate.yml: otp-version 27.0 ->
  27.3.4.19, so the test lanes run the release the runtime pins.
- test/httpc_redirect_credentials_test.exs: 10 cross-origin cases must
  not see the header; a same-origin control must. It passes on
  27.3.4.19 and fails all 10 cross-origin cases on 27.3.4.4.

The two echidnabot senders already set autoredirect: false; this covers
every other :httpc caller through the runtime pin.

Not changed: the 28.3 lanes in ci.yml and rsr-oracle.yml, which are pinned
to match the estate dogfood gate (28.3 also forwards); they need a
coordinated estate change.

Full suite on Elixir 1.17.3 / OTP 27.3.4.19: 2699 tests, 0 failures,
246 excluded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDgzT72Tq2HTJmikyNg
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Updated the Erlang/OTP version used by the project and its automated checks. The newer version addresses authorization handling on cross-origin HTTP redirects.
  • Tests
    • Added coverage for authorization headers across same-origin and cross-origin redirects for GET and POST requests.

The change pins Erlang/OTP to 27.3.4.19 in local tooling and selected workflows. It adds tests for authorization headers on same-origin and cross-origin redirects, using local TCP servers.

Changes: Redirect credential handling

Layer / File(s) Summary
Pin Erlang/OTP versions
mise.toml, .github/workflows/merge-orchestrate.yml, .github/workflows/tests.yml
The local Erlang version and selected workflow versions change to 27.3.4.19. The mise.toml comment notes the :httpc authorization behaviour for cross-origin redirects and the 27.3.4.13 threshold.
Test redirect authorization headers
test/httpc_redirect_credentials_test.exs
The tests check that cross-origin redirects omit authorization for GET and POST requests with statuses 301, 302, 303, 307 and 308. A same-origin GET test checks that authorization is retained.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: Moderate · up to 6dc03

An authenticated redirect can send credentials over an unencrypted connection under a narrow scheme-changing condition. Guard that path before merging unless the risk is explicitly accepted.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 9, 2026 15:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T23:22:45.599269Z 6dc0388 New commits
🔒 Security Review ❌ Failed 2026-11-09T23:20:41.162857Z
We couldn’t complete this review. Comment @codex security review to try again.
6dc0388 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@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: d0dce62819

ℹ️ 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 mise.toml
# Language runtimes
# Match the OTP 27 / Elixir 1.17 test lane in .github/workflows/tests.yml.
erlang = "27.3.4.4"
erlang = "27.3.4.19" # >= 27.3.4.13: :httpc drops authorization on cross-origin redirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the security floor at the complete redirect fix

When a configured service URL embeds credentials (for example, HYPATIA_VERISIM_URL=http://user:pass@host), versions 27.3.4.13–18 still forward that userinfo to a cross-origin redirect; this remaining CVE-2026-48856 case was only fixed in 27.3.4.19, as documented in the OTP 27.3.4.19 release notes. Because Hypatia.ServiceUrl.present/1 accepts such URLs unchanged and the new test supplies only an explicit Authorization header, downgrading according to this >= 27.3.4.13 comment would make the test pass while credentials still leak. State 27.3.4.19 as the minimum and cover URL userinfo in the regression test.

Useful? React with 👍 / 👎.

Comment on lines +10 to +11
# already set `autoredirect: false`; this test fails if the runtime itself
# regresses, so every other `:httpc` caller stays covered.

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 Enforce redirect safety in credentialed callers

When Hypatia runs outside the newly pinned mise/workflow lanes, this does not keep every caller covered: the public Hypatia.Reviewer.review_pr/3 path sends GITHUB_TOKEN in lib/hypatia/reviewer.ex with httpc's default autoredirect: true, while the repository still documents and provisions OTP 28.3 in .github/workflows/ci.yml and .github/workflows/rsr-oracle.yml, a version the change itself identifies as vulnerable. An API redirect to another host in that supported runtime therefore forwards the token despite this test passing only in the pinned OTP 27 lanes; disable automatic redirects or implement origin-checked redirects in each credentialed caller rather than relying solely on development and CI runtime pins.

Useful? React with 👍 / 👎.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 9, 2026 23:20
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 142380e into main Nov 9, 2026
89 of 90 checks passed
@hyperpolymath
hyperpolymath deleted the claude/clever-heisenberg-q9qp32 branch November 9, 2026 23:26
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.

3 participants