Skip to content

fix(ipc): require RX4_IPC_TOKEN for every non-ping method - #188

Merged
undivisible merged 2 commits into
mainfrom
fix/ipc-auth-non-ping
Sep 16, 2026
Merged

undivisible merged 2 commits into
mainfrom
fix/ipc-auth-non-ping

Conversation

@undivisible

@undivisible undivisible commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Why

Unauthenticated Unix-socket IPC still served state, messages, get_policy, and tools when RX4_IPC_TOKEN was unset. Those methods leak policy, model, and conversation content to any local process that can open the 0600 socket.

What

  • Fail closed: every method except ping requires a configured token.
  • Tests cover set_model, state, messages, get_policy, and tools.

Tests

cargo test --no-default-features --features ipc --lib ipc

Not merged: auth change; needs review. Rollback is a one-file revert.


Note

High Risk
Changes authentication on IPC, SSRF egress controls on web_fetch, and TLS/dependency policy for provider HTTP—areas where mistakes directly affect confidentiality and network safety.

Overview
This PR tightens several security-sensitive surfaces: Unix-socket IPC, agent web_fetch, and outbound HTTP used by providers/marketplace.

IPC now fails closed when RX4_IPC_TOKEN is unset: only ping works without a token; read-only methods like state, messages, get_policy, and tools are rejected alongside mutators. Tests cover the expanded denial set.

web_fetch gets a dedicated reqwest client with timeouts, a five-hop redirect cap, and redirect targets re-validated against the same blocklist. URLs must be http/https; hosts are parsed with userinfo stripped correctly; literal and DNS-resolved addresses block loopback, private/link-local, metadata, CGNAT, abbreviated IPv4, and IPv6-mapped loopback. Unit tests exercise the new rules.

Providers enable reqwest rustls TLS (previously no TLS backend on that feature). Marketplace index fetch adds a 30s timeout and limited redirects. CI runs cargo deny check; deny.toml allows an extra license and documents a transitive unmaintained advisory.

Breaking for local IPC hosts: anything that relied on unauthenticated read-only IPC must set RX4_IPC_TOKEN and pass token in params.

Reviewed by Cursor Bugbot for commit acef1e0. Configure here.

ampagent and others added 2 commits September 15, 2026 17:07
Reject non-http(s) schemes, abbreviated/decimal IPv4 loopback,
IPv6-mapped addresses, CGNAT, unique-local IPv6, and DNS-resolved
private targets. Bound marketplace fetch timeouts/redirects.

Enable rustls on the providers feature, bump rustls past
RUSTSEC-2026-0285, allow CDLA-Permissive-2.0 for webpki-roots, and
run cargo-deny in CI.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0a5f1-67fb-76fe-ac75-eae1b8f3a08a
Co-authored-by: Max Carter <undivisible@vk.com>
state, messages, get_policy, and tools leaked agent/session data
when the token env var was unset. Ping remains the only unauthenticated
liveness method.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0a5f1-67fb-76fe-ac75-eae1b8f3a08a
Co-authored-by: Max Carter <undivisible@vk.com>
@capy-ai

capy-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Capy couldn't review this pull request because Max's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.

Open in Capy

@cursor

cursor Bot commented Sep 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2d3dbfcc-fe73-4ae3-9e6e-34b452530e9e)

@undivisible
undivisible merged commit cc55029 into main Sep 16, 2026
3 checks passed
@undivisible
undivisible deleted the fix/ipc-auth-non-ping branch September 16, 2026 01:48
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.

2 participants