Sign all non-Model screen state with SerializableClosure HMAC#3095
Merged
Sign all non-Model screen state with SerializableClosure HMAC#3095
Conversation
Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/2a210efc-d504-45b6-ac8e-1439fbf6a783 Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
…dChannel/Message, fix select blade, fix RelationTest extraction Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/b5b15b86-7fd7-4874-8ad3-44d91a38d5f1 Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
…ames.php, fix Dusk test stability Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/fdf822a5-9287-4a89-a216-1eeb3950a3ba Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
…fix imports Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/b254d59b-c284-4b21-80a4-9d2ae4fa4a39 Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
…osure tests for screen serialization Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/a71f785a-72a9-4070-86f0-dd831edafcee Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
…reen property values Agent-Logs-Url: https://github.com/orchidsoftware/platform/sessions/ee7b51ae-6281-4444-af62-85918f6a78d1 Co-authored-by: tabuna <5102591+tabuna@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tabuna
April 12, 2026 02:11
View session
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.
Screen state is serialized and round-tripped through the client. Previously only
Closureproperties were HMAC-signed; primitives, arrays, and plain objects used bare PHP serialization — unsigned and tamperable.Changes
src/Screen/Concerns/SignedValue.php(new)Wraps any non-Model value in a signed
SerializableClosure:When
APP_KEYis set, Laravel'sEncryptionServiceProviderregisters an HMAC signer. Any payload modification throwsInvalidSignatureExceptionon deserialization.src/Screen/Concerns/ModelStateRetrievable.php__serialize— explicit dispatch replacing the genericgetSerializedPropertyValuefallback:Model\ClosureSerializableClosureModel/QueueableCollectionModelIdentifiernew SignedValue($value)__unserialize— symmetric type dispatch:SignedValue::restore()calls the captured closure to recover the original value;SerializableClosure::getClosure()returns the original callable;getRestoredPropertyValue()handlesModelIdentifierDB rehydration.tests/App/Screens/SerializeRetrievableScreen.phpAdded
ValueObject(a plain readonly DTO), plus typedarray $data,float $amount, and?ValueObject $valueObjectproperties to exercise non-Model serialization paths.tests/Unit/Screen/ScreenSerializeTest.phptestWithPrimitivesAndStdObject— coversint,string,float,array,stdClass; asserts"hash"present in each serialized payloadtestWithComplexObject— assertsValueObjectis captured inside a signedSerializableClosure(not aModelIdentifier), HMAC hash present, correct round-trip, zero DB queriestestClosureIsSignedWithAppKey— assertsSigned::$signeris non-null and closure round-trips correctly