Repository navigation
Encode workflow ids as one path segment in describe and update - #245
Merged
Merged
Conversation
describe_workflow and update_workflow put the workflow id (and update name) into the request path raw, so "/", "?" or "#" in an id addressed a different route and ".." collapsed onto another one. Both now percent-encode each identifier as one segment, and an empty, "." or ".." value returns Error::InvalidPathSegment before any request. Found in the security review of #243 (durable-workflow/.github#212). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Member
Author
|
Security PASS at 0a1dce7 (CI 17 passed, 2 skipped). |
Merged
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.



Follow-up from the security review of #243. Refs durable-workflow/.github#212. It is kept separate from #243 as requested.
Problem:
describe_workflowandupdate_workflow_responsebuilt their paths with the rawworkflow_id(and update name). A/,?or#in an id addressed a different route, and..collapsed/workflows/..onto another one.Change
path_segment(field, value)helper. It percent-encodes the value the same way asRawRequestsegments and refuses an empty,.or..value with the newError::InvalidPathSegment { field }.describe_workflowencodesworkflow_id.update_workflow/update_workflow_avro_valueencodeworkflow_idandupdate_name, and the check runs before any request, including payload-policy discovery.Tests: ids containing
/,?,#and spaces stay in one encoded segment for describe and update. Empty,.and..workflow ids and update names are refused with nothing sent.Local (rust 1.86.0 in Docker):
cargo fmt --check,cargo test --locked --all-targets --all-features(976 passed, 0 failed), doctests, andcargo doc -D warningsall clean.Not covered: ten other control-plane paths still interpolate ids raw: signal, query, workflow commands (cancel/terminate/…), redrive, message streams and
describe_workflow_run. They need the same treatment in a follow-up.🤖 Generated with Claude Code