Skip to content

fix(weave): refuse code-bearing custom objects on server-side decode#7004

Draft
gtarpenning wants to merge 1 commit into
masterfrom
gtarpenning/wb-34909-server-decode-guard
Draft

fix(weave): refuse code-bearing custom objects on server-side decode#7004
gtarpenning wants to merge 1 commit into
masterfrom
gtarpenning/wb-34909-server-decode-guard

Conversation

@gtarpenning
Copy link
Copy Markdown
Member

@gtarpenning gtarpenning commented May 28, 2026

Summary

  • Server-side workers (the evaluate-model worker) reconstruct user-supplied objects. A small set of custom types deserialize by loading code (the Op custom type, and anything that falls back to a load_op), which is fine for a normal client but not for a server worker acting on someone else's payload.
  • Adds a per-client policy WeaveClient.allow_unsafe_custom_obj_decode (default True). The decode path (custom_objs._decode_custom_obj) consults it via the ambient client and refuses to reconstruct code-bearing custom types when it's off. The worker flips it off, so every payload it touches is covered, including dataset rows materialized lazily during evaluation.
  • Decode-time guard means a single choke point rather than pre-scanning each payload; the shared is_safe_to_decode predicate is pure and unit-tested. The worker also rejects op refs passed directly as the evaluation/model ref (client.get would load and run them before decode applies).
  • Tracking: WB-34909

Testing

unit tests for is_safe_to_decode and the object-ref guard, a sync check that every KNOWN_TYPES entry is consciously classified safe-or-Op, plus an end-to-end evaluate-model test where an Op row in a dataset is refused at decode time.

Server-side workers (the evaluate-model worker) reconstruct user-supplied
objects. Gate custom-object deserialization on a per-client policy
(WeaveClient.allow_unsafe_custom_obj_decode, default True) so workers can
refuse to reconstruct Op / load_op-backed custom types at decode time,
including dataset rows materialized lazily during evaluation.

https://coreweave.atlassian.net/browse/WB-34909

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant