Repository navigation
Conversation
Signed-off-by: João Pedro Brun <joao.pedro.brun@sap.com>
This branch has not been deployed
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.
Description
Caller-supplied memory and message IDs were inserted directly into URL paths, allowing reserved characters to change the request URL. Encode
memory_idandmessage_idwithquote(..., safe="")in memory retrieval, update and deletion, and message retrieval and deletion. Preserve the surroundingmemories(<id>)andmessages(<id>)syntax, identifier spelling and request bodies. Encoding failures raise the existingAgentMemoryHttpError.Related Issue
N/A
Type of Change
How to Test
Run from the repository root after checking out this branch.
Run the Agent Memory unit suite:
Expected: 252 passed, including 13 regression cases covering all five URL call sites, pre-encoded inputs, UUID spelling preservation, dot values and encoding failures.
Compare the old URL construction with the updated client. This example prepares requests with
Session.sendmocked; it sends no network requests:Expected:
Before,
..changes the path,injected=yesbecomes a query, andfragment)becomes a URL fragment. Fragments are not sent in the HTTP request target. After, those characters remain encoded inside the memory identifier.Run the repository checks:
Expected: formatting, lint, whitespace and type checks pass. Unchanged YAML and lock-file hooks are skipped.
Checklist
/security-reviewand addressed all ❌ findingsBreaking Changes
No breaking changes for documented Agent Memory usage. Public client signatures, request bodies, and URLs for valid memory and message UUIDs are unchanged. These callers need no migration. UUID validation and normalization are not added.
This security fix changes how other identifier inputs behave:
),/,?,#, and%are encoded as identifier data instead of being interpreted as URL structure.AgentMemoryHttpErrorbefore an HTTP request.Literal
.and..values remain allowed because they stay insidememories(...)ormessages(...), rather than forming standalone path segments.These behavior changes affect inputs outside the service's documented UUID format; identical behavior for every previously accepted input is not claimed.
Additional Notes
None