Skip to content

[Server] Restrict FileSessionStore::gc() to owned session files - #32

Closed
chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-24-filesession-gc
Closed

chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-24-filesession-gc

Conversation

@chr-hertel

Copy link
Copy Markdown
Owner

gc() unlinked any stale file in the session directory and only then checked whether the name was a UUID — pointing the store at a shared directory could delete unrelated files. Now the filename is validated as an RFC 4122 UUID before any unlink, so gc only touches files the store owns.

Closes #24

Confidence: 9/10 — small, well-tested guard with no behavior change for real session files.

@chr-hertel

Copy link
Copy Markdown
Owner Author

merged upstream with modelcontextprotocol#479

@chr-hertel chr-hertel closed this Aug 24, 2026
@chr-hertel
chr-hertel deleted the fix/issue-24-filesession-gc branch August 24, 2026 22:44
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.

[C1] FileSessionStore::gc() deletes any file in its directory, then checks the name

1 participant