Title: id(world_net): policy_request never validates the policy reply — a missing or mistyped policy reads as Ok(null)/verbatim, so an isolation-boundary change reports success with no policy · Issue #6625 · developing-today/code · GitHub
Open Graph Title: id(world_net): policy_request never validates the policy reply — a missing or mistyped policy reads as Ok(null)/verbatim, so an isolation-boundary change reports success with no policy · Issue #6625 · developing-today/code
X Title: id(world_net): policy_request never validates the policy reply — a missing or mistyped policy reads as Ok(null)/verbatim, so an isolation-boundary change reports success with no policy · Issue #6625 · developing-today/code
Description: Problem WorldClient::policy_request (pkgs/id/src/world_net.rs:1112-1127, on origin/main 075b2de) — the shared reply path for set_cross_world_write (:1061), force_cross_world_write (:1080) and set_file_scope (:1097) — checks only that the...
Open Graph Description: Problem WorldClient::policy_request (pkgs/id/src/world_net.rs:1112-1127, on origin/main 075b2de) — the shared reply path for set_cross_world_write (:1061), force_cross_world_write (:1080) and set_f...
X Description: Problem WorldClient::policy_request (pkgs/id/src/world_net.rs:1112-1127, on origin/main 075b2de) — the shared reply path for set_cross_world_write (:1061), force_cross_world_write (:1080) and set_f...
Opengraph URL: https://github.com/developing-today/code/issues/6625
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(world_net): policy_request never validates the policy reply — a missing or mistyped policy reads as Ok(null)/verbatim, so an isolation-boundary change reports success with no policy","articleBody":"## Problem\n\n`WorldClient::policy_request` (`pkgs/id/src/world_net.rs:1112-1127`, on\n`origin/main` 075b2de904) — the shared reply path for\n`set_cross_world_write` (:1061), `force_cross_world_write` (:1080) and\n`set_file_scope` (:1097) — checks only that the reply's `type` is\n`\"policy\"` and then returns the policy field unchecked:\n\n```rust\nOk(reply[\"policy\"].clone()) // :1126\n```\n\nA `policy` reply with the `policy` field **missing** returns `Ok(null)`;\na mistyped field (e.g. `123`, `\"deny\"`) returns `Ok(123)` / `Ok(\"deny\")`\nverbatim. These are admin operations on the world's isolation boundary —\nwhether other worlds may write into this one, and whether its files are\nconfined to the world root — so a malformed reply silently reads as a\nsuccessful policy change whose resulting policy is unknown.\n\nThe host's real reply is always a structured object:\n`world_session/mod.rs:1058` sends `ServerFrame::Policy { world, policy }`\nwith `policy: WorldPolicy` (`world/mod.rs:510` — isolation,\ncross_world_write, cross_world_forced, file_scope,\nfile_write_override). And the sibling client method in the same file is\nthe oracle: `set_isolation` (:1135) refuses a missing/mistyped field\nwith `.context(\"host sent no isolation\")`. `policy_request` is the\noutlier.\n\n## Verified this run (laptop probe, real `id` crate, scripted host)\n\nProbe `~/git/fleet/probe-policy-wt/pkgs/id/tests/probe_policy_reply.rs`\n(scripted host answering one canned frame per connection, same harness\nas the #6620/#6621 probes), test `probe_policy_reply_shapes`:\n\n- CONTROL well-formed `policy` object via `set_cross_world_write` →\n `Ok` with the policy object (`cross_world_write: true`).\n- CASE `{\"type\":\"policy\",\"world\":\"arena\"}` (field missing) via\n `set_cross_world_write` → `Ok(null)`.\n- CASE `policy: 123` via `set_file_scope` → `Ok(123)`.\n- CASE `policy: \"deny\"` via `force_cross_world_write` →\n `Ok(\"deny\")`.\n\n## Why it matters\n\nThe CLI prints the returned value as the outcome of the change\n(`commands/world.rs` CrossWorldWrite / ForceCrossWorldWrite / FileScope\narms pretty-print the result and exit 0). A buggy, downgraded, or\nhostile host that answers `{\"type\":\"policy\"}` with no usable policy\nleaves the operator believing cross-world writes were enabled/disabled\nor the file scope was set — with `null` (or garbage) as the only\n\"evidence\". For an isolation control, \"changed, probably\" is the\nfailure mode the reply exists to prevent. Same unchecked-clone family\nas #6624 (`caps`/`update_caps`), different endpoint and a\nsecurity-boundary payload; the fix here is independent.\n\n## Acceptance criteria\n\n- `policy_request` rejects a `policy` reply whose `policy` field is\n missing or not a well-formed `WorldPolicy` object (deserialize into\n the typed struct, adding `Deserialize` to `WorldPolicy` if needed,\n or validate the object shape explicitly), with an error naming the\n malformed reply — mirroring `set_isolation`'s \"host sent no\n isolation\" refusal in the same file.\n- All three callers (`set_cross_world_write`,\n `force_cross_world_write`, `set_file_scope`) inherit the check via\n the shared helper.\n- Regression tests with a scripted host: missing field, numeric,\n string, and array `policy` values all error; a well-formed policy\n reply still returns the policy unchanged.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-06T22:01:40Z","url":"https://github.com/developing-today/code/issues/6625"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9cc6548-5d9c-c133-6b33-0cdddb5e9f11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E3FE:25D6FF:3AE341:4FC4AB:6B076459 |
| html-safe-nonce | edf3baaa31547e6ba12981b846f20d4f15202784446af888aa3df6d11d12c6ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0ZFOjI1RDZGRjozQUUzNDE6NEZDNEFCOjZCMDc2NDU5IiwidmlzaXRvcl9pZCI6IjY2NDU3ODU1NTA5NzA2NDM1NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5060f614752b83faea521b95dde6a62c688ce7c631caf30566aee55e9d3346bc |
| hovercard-subject-tag | issue:6251412868 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6625/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce1aa29e6ec2288b94e6077107542eb5ebf4759151cb2062ff465f86813721cc/developing-today/code/issues/6625 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce1aa29e6ec2288b94e6077107542eb5ebf4759151cb2062ff465f86813721cc/developing-today/code/issues/6625 |
| og:image:alt | Problem WorldClient::policy_request (pkgs/id/src/world_net.rs:1112-1127, on origin/main 075b2de) — the shared reply path for set_cross_world_write (:1061), force_cross_world_write (:1080) and set_f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7a557ecc960a3ae6e299fc66b0bc9132072f8860191648e6749fee5d3ff00d82 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bd845eb7947c1ed8c850f7ab415a51339d162de3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width