mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-12 01:03:45 +00:00
* 🛡️ fix: Scope agent-author file access to attached files only
The hasAccessToFilesViaAgent helper short-circuited for agent authors,
granting access to all requested file IDs without verifying they were
attached to the agent's tool_resources. This enabled an IDOR where any
agent author could delete arbitrary files by supplying their agent_id
alongside unrelated file IDs.
Now both the author and non-author paths check file IDs against the
agent's tool_resources before granting access.
* chore: Use Object.values/for...of and add JSDoc in getAttachedFileIds
* test: Add boundary cases for agent file access authorization
- Agent with no tool_resources denies all access (fail-closed)
- Files across multiple resource types are all reachable
- Author + isDelete: true still scopes to attached files only
|
||
|---|---|---|
| .. | ||
| Action.js | ||
| Action.spec.js | ||
| Agent.js | ||
| Agent.spec.js | ||
| Assistant.js | ||
| balanceMethods.js | ||
| Banner.js | ||
| Categories.js | ||
| Conversation.js | ||
| Conversation.spec.js | ||
| ConversationTag.js | ||
| convoStructure.spec.js | ||
| File.js | ||
| File.spec.js | ||
| index.js | ||
| interface.js | ||
| inviteUser.js | ||
| loadAddedAgent.js | ||
| Message.js | ||
| Message.spec.js | ||
| Preset.js | ||
| Project.js | ||
| Prompt.js | ||
| Prompt.spec.js | ||
| PromptGroupMigration.spec.js | ||
| Role.js | ||
| Role.spec.js | ||
| spendTokens.js | ||
| spendTokens.spec.js | ||
| ToolCall.js | ||
| Transaction.js | ||
| Transaction.spec.js | ||
| tx.js | ||
| tx.spec.js | ||
| userMethods.js | ||