Skip to content

fix(minvmd): record no reply flow sourced from the egress proxy's address - #2073

Merged
norrietaylor merged 4 commits into
mainfrom
inbox-patch/fix/observe-delivered-decline-proxy-sourced-replies-63e9689f1e322dc2
Oct 7, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
inbox-patch/fix/observe-delivered-decline-proxy-sourced-replies-63e9689f1e322dc2

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVrwbJQ

Fixes gominimal/inbox#1002.

ReplyTables::observe_delivered records a reply flow from any delivered
opening packet at a published inside port. As defense in depth, it now
declines to record a flow whose source is the switch subnet's
Box Egress Proxy address: the proxy is host-side infrastructure no box
ever dials through, so a flow claiming that source earns no reply record.

The decline precedes the record itself — None is returned before any
entry is consulted or minted, so a proxy-sourced dial mints no entry
(record_count_of is None, not Some(0)), and the production caller
treats it identically to an untracked frame: deliver, record nothing.

This is not the primary control. A lane-less box's direct connection to
the proxy listener is already refused by minvmd's gate, and by the relay
leg per #1885. This change only closes off the reply
path so it can never grant the proxy address anything either.

Changes

  • Thread SwitchSubnet into observe_delivered and refuse frames whose
    source equals box_egress_proxy_address() before consulting the table.
  • Update the production caller and the four test call sites.
  • Add proxy_sourced_dial_records_no_reply_flow, asserting the
    proxy-sourced dial mints no record and the box's answer is refused as
    the proxy-lane drop.

Verification

  • cargo fmt --all --check — clean.
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean.
  • cargo test --locked -p minvmd --lib net::egress_gate::tests — 85 passed,
    including the new test.

The full -p minvmd suite reports 402 passed / 3 failed; the three failures
(net::answerer::tests::* tracing subscriber double-install, and
sock::tests::resolve_uds_path_lives_in_provider_dir path assumption) are
pre-existing and unrelated to this change, which touches only
crates/minvmd/src/net/egress_gate.rs.

Summary by CodeRabbit

  • Bug Fixes
    • Traffic originating from the egress proxy no longer creates or updates a reply path for a box. The inbound packet is still forwarded, but attempts by the box to respond through that proxy-originated connection are refused. Other inbound traffic continues to use the existing reply handling.

observe_delivered records a reply flow for every delivered frame the
forwarder opens, and mints an entry before any verdict is consulted.
A frame sourced from the switch subnet's Box Egress Proxy address is
host-side infrastructure no box ever dials through, yet it would
otherwise record a flow, letting the box reverse-answer a stream the
proxy originated.

Refuse such frames before consulting or minting any record. This is
defense in depth: gate_verdict already refuses a box's frames *to* the
proxy, but a proxy-sourced frame wearing the box's lease would still
record and open an admit. Returning None keeps delivery and records
nothing, matching the existing Untracked behaviour.

Thread the SwitchSubnet into observe_delivered so the caller supplies
the subnet already held on the table, and cover it with
proxy_sourced_dial_records_no_reply_flow.
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 7, 2026 20:05
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

Or wait 15 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a2b8e09c-a2ca-4432-8fb0-0b9e9d5e658e
📥 Commits

Reviewing files that changed from the base of the PR and between b30503e and 6d22989.

📒 Files selected for processing (1)
  • crates/minvmd/src/net/egress_gate.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 8bf65a22-5775-4b7d-a983-4e601ee6b627
📥 Commits

Reviewing files that changed from the base of the PR and between ac88988 and b30503e.

📒 Files selected for processing (1)
  • crates/minvmd/src/net/egress_gate.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/minvmd/src/net/egress_gate.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

observe_delivered now receives the switch subnet and skips reply-flow tracking for packets sourced from the Box Egress Proxy address. A new test checks that the box's response is refused.

Changes

Proxy-Sourced Reply-Flow Exclusion

Layer / File(s) Summary
Exclude proxy-sourced packets from reply-flow tracking
crates/minvmd/src/net/egress_gate.rs
The ingress relay passes the switch subnet to observe_delivered. The method skips recording a reply flow when the packet source is the Box Egress Proxy address. A test checks that no reply-flow entry is created and the box's response is refused. Existing tests pass the subnet to the updated method.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to b3050

No actionable issue remains from the supplied evidence; the change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preventing reply-flow recording for traffic sourced from the egress proxy address.
Description check ✅ Passed The description provides the change summary, linked issue, implementation details, test coverage, command results, and known unrelated failures. It omits the template's explicit Checklist section, but…
Linked Issues check ✅ Passed Issue #1002 is an active direct linked issue. observe_delivered receives SwitchSubnet and returns None when the source equals box_egress_proxy_address() before the reply table is accessed. The…
Out of Scope Changes check ✅ Passed The diff changes the required method signature, updates its production and test call sites, and adds a focused regression test. The comments document the requested defense-in-depth behavior. These cha…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit guards the proxy lane,
No false reply-flow takes the reign.
The subnet joins the packet's track,
The proxy source gets no flow back.
The box replies; the gate says no,
Then onward through the tests we go.

Comment @coderabbitai help to get the list of available commands.

@norrietaylor norrietaylor changed the title fix: Record no reply flow sourced from the egress proxy's address fix(minvmd): record no reply flow sourced from the egress proxy's address Oct 7, 2026
@norrietaylor

Copy link
Copy Markdown
Member

/review

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 7, 2026
@minimal-foundry

minimal-foundry Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at 6d229897285a.

Nothing to do.

Clobber: none: git log on the file shows only these three commits since base; nothing reverted.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 7, 2026
@norrietaylor

Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

…s proxy

gate_verdict's reply-flow admit now skips any frame whose destination is the
subnet's Box Egress Proxy address, so no record, however minted, admits a box
frame to the proxy; such frames go on to the proxy lane arm, which decides by
the row's lane declaration (NET-134). The observe_delivered decline stays as
a second layer.

Correct the premise in the observe_delivered and test docs: a credentialed
lane's box does dial the proxy's listener (NET-134); the proxy only answers
and never opens a connection toward a box, so a proxy-sourced opening packet
at a published port has no legitimate origin.

Add reply_flow_record_never_admits_a_frame_to_the_proxy, which mints the
record directly on the entry's flow table, bypassing the decline.
@norrietaylor

Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

@norrietaylor

Copy link
Copy Markdown
Member

/review

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 222920f Oct 7, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/fix/observe-delivered-decline-proxy-sourced-replies-63e9689f1e322dc2 branch October 7, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants