Skip to content

fix(callouts): isolate outbound connections and refuse the API's own addresses - #639

Open
Bccorb wants to merge 2 commits into
mainfrom
fix/outbound-call-hardening
Open

Bccorb wants to merge 2 commits into
mainfrom
fix/outbound-call-hardening

Conversation

@Bccorb

@Bccorb Bccorb commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Part of #601 (review bundle 2): L-API-9, L-API-10 and L-API-11. L-API-12 follows in a separate PR.

L-API-9: outbound connections no longer share a pool

Callouts (webhooks, login hooks, OTLP sinks) and OAuth provider requests used Node's global keep-alive agent, whose pool is keyed by destination and not by the lookup that enforces each policy's private-host list. Both request paths now pass agent: false, so every request opens its own connection and runs its own connect-time check. Syslog sinks already opened their own sockets.

L-API-10: a callout cannot reach the API under another name

  • The issuer host comparison now ignores case and trailing dots. CALLOUT_PRIVATE_HOSTS entries are normalised the same way.
  • At connect time, a callout is refused when it resolves to a private or loopback address that ISSUER also resolves to, on the ISSUER port. Loopback counts as one address, and loopback on the port the API listens on (PORT) is always refused. IP literal targets, which skip DNS, are checked before connecting.
  • Public addresses are not compared. Edge networks and load balancers put unrelated sites on one public address, so comparing them would refuse receivers that are not this server, and a public address reaches only what any internet client reaches.

L-API-11: version and route map stay public

Accepted and documented in docs/security-posture.md. Server adapters fetch /.well-known/seamless-adapter.json before they hold any credential, and its route map already narrows the release to a range, so hiding /health/version alone would not hide the version. The operator checklist also reads /health/version to confirm a deployment. No response shape changes.

Docs

docs/configuration.md and ADR 0005 E8 now describe the behavior above instead of the two gaps.

Compatibility

No route, schema or response change. A callout that resolves to the API's own private or loopback address on its port, or to loopback on the API's listen port, is now refused; any such callout was calling the API itself. Development receivers on another port of localhost keep working.

Checks

npm run typecheck, npm run lint, npm run format:check and npm run coverage (3692 tests, 99.1% lines, 95.94% branches) pass. The new keep-alive tests fail without agent: false.

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