fix: fail-closed localization allowlist and serialize vLLM kv-transfer JSON - #1306
Merged
xiaofei-zheng merged 1 commit intoAug 30, 2026
Merged
Conversation
Empty trusted roots previously returned no violations (fail-open). Treat every touched path as out of bounds instead. Build vLLM --kv-transfer-config with json.dumps so connector names cannot break or inject JSON fields; unknown names warn and still pass through. Co-authored-by: Cursor <cursoragent@cursor.com>
CI E2E report — ❌ Timeout
|
xiaofei-zheng
approved these changes
Aug 30, 2026
xiaofei-zheng
deleted the
bugfix/siliang/allowlist-failclosed-kv-transfer-json
branch
August 30, 2026 02:52
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.
Description
Two independent fixes. No change to the session breakdown contract.
_localization_paths_outside_allowlist()returned[], which the caller reads as "no violations" and applies the diff. With no root, no path can be proven in-bounds, so every non-empty touched path is now reported as out of bounds. The caller already reverts on a non-empty list (localization_outside_allowlist). This is defensive:resolve_source_file_allowlist()/_merge_roots()only drop blanks and duplicates and never check that directories exist, so the five static default roots are always present, and the call site also appendsframework_root. The production path does not reach the empty-root branch today.--kv-transfer-configJSON was built with an f-string, and--pd-transfer-backendis free text (nochoices=). A connector name containing a quote produced illegal JSON that only failed when the remotevllm serveparsed it, and a value shaped likeNixlConnector","kv_buffer_size":"1000000000produced valid JSON carrying an extra field with no error at all. The config is now built withjson.dumps(). Unknown connector names log a warning and still pass through so a future vLLM connector is not blocked. The shell layer was already safe (shlex.quoteper argv); this is the JSON layer.Linked issue(s)
None.
Tests
framework_rootalone still admits paths inside that treejson.loadsas a single escaped field; default prefill / decode roles unchanged90 passed on the targeted tests.
ruff check/ruff format --checkon the changed files passed.Breaking changes
No. Localization with no trusted root now reverts instead of applying. The vLLM PD launch argv is unchanged for well-formed connector names; malformed names stay one escaped field instead of breaking or injecting JSON.