fix(q): restrict outbound q-wire builtins under IPC - #6
Merged
singaraiona merged 1 commit intoSep 3, 2026
Merged
Conversation
Register the outbound q-wire builtins with RAY_FN_RESTRICTED instead of RAY_FN_NONE. Without the flag, a -U native IPC client could call .q.connect and force the server to open arbitrary outbound q-wire connections (SSRF-style); .q.send and .q.close were likewise unguarded. The core enforcement gate (lang/eval.c: __VM->restricted && (fn_obj->attrs & RAY_FN_RESTRICTED)) now blocks these verbs for restricted IPC clients, while full-privilege local/embedded callers are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How it looks from the user's side
A restricted native IPC client connects to a
rayforce-qserver started with-U pwand asks the server to open an outbound q-wire connection:Before -- the restricted client could force the server to connect out to the q target:
After -- the same restricted IPC request is denied before any outbound q-wire connection is opened:
The client-side error formatting in this repro is coarse, so the target-side accept is the key observable: before the fix the fake q target accepts a connection; after the fix it does not.
What changed
Registers the outbound q-wire builtins as restricted:
.q.connect.q.send.q.closeThese now use
RAY_FN_RESTRICTEDinstead ofRAY_FN_NONE, matching the native IPC networking verbs such as.ipc.open,.ipc.send, and.ipc.close.With
rayforce -U, the core evaluator already blocks functions markedRAY_FN_RESTRICTED, so restricted IPC clients can no longer use.q.connectto make the server initiate outbound q-wire connections. Local and unrestricted callers keep the same behavior.Tests
Targeted repro was run against both
origin/masterand this branch to confirm the before/after accept behavior.