Skip to content

fix(serdes): FileSystemSerDes.deserialize must not trust the envelope's file path - #1007

Draft
SilanHe wants to merge 1 commit into
aws:mainfrom
SilanHe:fix/filesystem-serdes-path-trust
Draft

SilanHe wants to merge 1 commit into
aws:mainfrom
SilanHe:fix/filesystem-serdes-path-trust

Conversation

@SilanHe

@SilanHe SilanHe commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1006.

deserialize read whatever path the {"file": path} envelope held, with no check against base_path, the execution, or the entity. For a callback result, that envelope is written by the external system calling SendDurableExecutionCallbackSuccess, not by this SDK's own serialize, so a forged path could read another execution's checkpoint file on the same shared mount.

serialize builds the path from base_path, the execution ARN, the operation ID, and the path encoding. All four stay the same on replay. deserialize now rebuilds the same path and reads that file, ignoring the envelope's file value entirely. Ports the JS fix: aws/aws-durable-execution-sdk-js#1219

Behavior change. serialize is never called for a callback result, so no file exists at the path deserialize now insists on. A callback or wait_for_callback whose config sets FileSystemSerDes, where the external responder previously sent back a {"file": "<path>"} envelope, now fails with FileNotFoundError wrapped as SerDesError. The responder should send {"data": "<JSON>"} instead; CallbackConfig.serdes's docstring now says so.

Tests added: round-trip of what serialize wrote, an envelope pointing at another execution's file, another entity's file, and a path outside base_path, each under both URI and HASH encoding. 2224 tests pass.

🤖 AI-assisted comment

@SilanHe
SilanHe force-pushed the fix/filesystem-serdes-path-trust branch from a9c9da0 to 81f0fca Compare December 1, 2026 23:44
@SilanHe
SilanHe force-pushed the fix/filesystem-serdes-path-trust branch from 81f0fca to b5d5714 Compare December 2, 2026 16:21

This branch has not been deployed

No deployments
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.

fix(serdes): FileSystemSerDes.deserialize must not trust the envelope's file path

2 participants