Fail-closed json/plain Oj deserialize (SECBUGS-174) - #359
Open
d2army wants to merge 6 commits into
Open
Conversation
SECBUGS-174: reject arbitrary ^o instantiation while keeping custody Request/Response payloads and error serialization v2 working. Co-authored-by: Cursor <cursoragent@cursor.com>
Unconstrained bundle install was pulling protobuf 4, which cannot load the generated stubs, and ubuntu-latest no longer ships docker-compose. Co-authored-by: Cursor <cursoragent@cursor.com>
docker compose now starts, but auto-setup is not ready after a 10s sleep, so register_namespace hits connection refused. Co-authored-by: Cursor <cursoragent@cursor.com>
auto-setup: latest never bound gRPC with Cassandra 3.11 on GitHub runners. Dump compose logs if the wait still times out. Co-authored-by: Cursor <cursoragent@cursor.com>
Example workflows return Metadata::Workflow and Struct.new results. Those are first-party Oj encodings, not gadget classes. Co-authored-by: Cursor <cursoragent@cursor.com>
Oj puts ^o Thread::Backtrace on ~bt_locations. Rename the unit file to json_spec.rb so CI actually runs it. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Temporal::JSON.deserializefor SECBUGS-174:JSON.parsefirst, reject disallowed Oj class directives, thenOj.loadthe original bytes so encode, symbol keys, and^tstay compatible.Temporal::types, loaded::Request/::Response(custody Gojson:"^o"), loaded Exception subclasses (error serialization v2), Oj Exception backtrace types (Thread::Backtrace), andTemporal::JSON.allow_class. Anonymous Structs (^uwith member names) round-trip.^cclass references require a loaded constant. Gadget classes such asGem::RequirementraiseTemporal::JSONDisallowedClassErrorbeforeOj.load.json/plain. This PR is 0.0.7 ontransfers-master. #356 waits and is now 0.0.8.transfers-masterPRs.test_gempinsgoogle-protobuf ~> 3.25.test_examplesusesdocker composev2, pinned Temporal 1.22.4 images, and waits for port 7233. Tracking: COR3-130.Test plan
bundle exec rspec spec/unit(629 examples, 0 failures){"^o":"...::Request","scope":"..."}reconstitutes a loaded RequestGem::Requirement/Kernel/ nested gadgets raise beforeOj.loadTemporal::Metadata::Workflow, anonymous Struct, and raised Exception (includingThread::Backtrace) round-triptest_gemandtest_exampleson this PRtemporal-ruby 0.0.6and tx_service exact pin'0.0.6'