mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
fix(mcp): resolve security access scope bypass in getDocument tool
This commit is contained in:
parent
f11d8c4620
commit
2e444ff8cd
1 changed files with 5 additions and 2 deletions
|
|
@ -32,9 +32,12 @@ export function register(deps: ToolDeps) {
|
|||
const effectiveTag = await deps.resolveContainerTag()
|
||||
const client = deps.getClient()
|
||||
const document = await client.getDocument(args.documentId)
|
||||
const docTags = document.containerTags
|
||||
const docTags = Array.isArray(document.memoryEntries)
|
||||
? document.memoryEntries
|
||||
.map((entry: any) => entry.spaceContainerTag)
|
||||
.filter(Boolean)
|
||||
: []
|
||||
if (
|
||||
Array.isArray(docTags) &&
|
||||
docTags.length > 0 &&
|
||||
!docTags.includes(effectiveTag)
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue