You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): #323 block external access to file and internal actions - #327
No actionable comments were generated in the recent review.
Walkthrough
File actions are excluded from Socket.IO and /api routes. The file service validates upload identity and stream shape, and integration tests cover route access, authentication, uploads, and static-file responses.
The Socket.IO blacklist and /api whitelist exclude file actions. file.save disables Socket.IO, and selected actions are explicitly marked public. Tests check rejection of file actions over Socket.IO.
file.save rejects requests without a user ID and invalid upload streams. Its metadata log omits the token and translation function. Tests check rejection behavior and confirm the save operation is not called for invalid requests.
Exercise gateway access and upload routes server/test/integration/gateway/gateway.spec.ts, server/test/integration/gateway/gatewayAccessControl.spec.ts
Integration tests check responses for unpublished routes, upload authentication, authenticated uploads, static-file headers, and the published file action list.
sequenceDiagram
participant Client
participant Gateway
participant FileService
participant saveFileStream
Client->>Gateway: Send upload request with token
Gateway->>FileService: Forward authenticated upload
FileService->>saveFileStream: Pass user ID and stream
saveFileStream-->>FileService: Return result or error
Loading
Possibly related issues
msgbyte/tailchat#323: The issue reports external access to file reads and writes. This change blocks external routes to file actions, but does not establish that the additional impacts described in the issue are resolved.
Merge Risk: Minimal · up to cb778
This change blocks external Socket.IO and /api access to file actions and rejects uploads with no user identity or an invalid stream. It adds integration tests for route access, authentication and uploads. No concrete merge-blocking risk was found, though the tests have not been run.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: blocking external access to file actions and internal actions in the server. The changeset adds a blacklist entry for the file.* namespace in the Socket.IO mixin, bloc…
Full details: Title check
Explanation
The title names the main change: blocking external access to file actions and internal actions in the server. The changeset adds a blacklist entry for the file.* namespace in the Socket.IO mixin, blocks file.* routes under /api in the gateway, restricts file.save with new permission and stream checks, and adds tests for these controls. The title's '#323' reference does not match the PR objectives, which cite PR #327. That mismatch does not affect the title's relevance to the change, so the check passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
moonrailgun
changed the title
fix(server): block external access to file and internal actions
fix(server): #323 block external access to file and internal actions
Nov 25, 2026
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
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.
Fixes #323
Summary by CodeRabbit
/apigateway, and unpublished actions return 404 responses.nosniffheaders.