mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-02 12:22:22 +00:00
Render non-app (no profile=mcp-app) ui:// HTML inert: the static srcDoc iframes in ToolCall, MCPUIResource, and UIResourceCarousel now use sandbox="" so scripts and forms run only through the CSP-applying sandbox proxy. Make the proxy's meta CSP unbypassable by wrapping any document whose markup precedes <head>, so nothing untrusted is parsed before the policy takes effect. Fail closed in resolveAppContext when MCP auth-value resolution throws, logging and rejecting rather than proceeding with unresolved or stale credentials. Validate each MCP_SANDBOX_FRAME_ANCESTORS token against a scheme://host[:port] pattern so a stray ";" cannot inject an extra CSP directive. Rate-limit the app resource endpoints (resources/read, list, templates/list) per user, and correct AppToolResult.content from an empty-tuple type to unknown[]. Add controller tests for the frame-ancestors validation and the auth fail-closed path. |
||
|---|---|---|
| .. | ||
| __test-utils__ | ||
| __tests__ | ||
| admin | ||
| agents | ||
| assistants | ||
| files | ||
| types | ||
| accessPermissions.js | ||
| accessPermissions.sharePolicy.test.js | ||
| accessPermissions.test.js | ||
| actions.js | ||
| apiKeys.js | ||
| auth.2fa-ratelimit.test.js | ||
| auth.cloudfront.test.js | ||
| auth.js | ||
| balance.js | ||
| banner.js | ||
| categories.js | ||
| config.js | ||
| convos.js | ||
| endpoints.js | ||
| index.js | ||
| keys.js | ||
| mcp.js | ||
| memories.js | ||
| messages.js | ||
| models.js | ||
| oauth.js | ||
| oauth.test.js | ||
| presets.js | ||
| projects.js | ||
| prompts.js | ||
| prompts.test.js | ||
| roles.js | ||
| rum.js | ||
| search.js | ||
| settings.js | ||
| share.js | ||
| skills.js | ||
| skills.tenant.test.js | ||
| skills.test.js | ||
| static.js | ||
| tags.js | ||
| user.js | ||