Skip to content

Harden file middleware paths and fix legacy response events - #1390

Merged
asika32764 merged 3 commits into
masterfrom
copilot/fix-fileprocessmiddleware-issue
Nov 8, 2026
Merged

asika32764 merged 3 commits into
masterfrom
copilot/fix-fileprocessmiddleware-issue

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

FileProcessMiddleware relied on URI normalization to prevent traversal, and HttpServerTrait emitted a misspelled legacy response event. ReactServer dispatches events directly and does not run middleware.

  • Path traversal: Reject parent-directory segments after URL decoding and separator normalization; unsafe paths continue to the next handler.
  • Legacy events: Correct the event name to response.
  • ReactServer: Document its direct event dispatch behavior.
$middleware = new FileProcessMiddleware($publicPath);
// /%2e%2e/secret.txt is delegated, not served from outside $publicPath.

Copilot AI linked an issue Nov 7, 2026 that may be closed by this pull request
Co-authored-by: asika32764 <1639206+asika32764@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix FileProcessMiddleware and spelling in adaptLegacyEvents Harden file middleware paths and fix legacy response events Nov 7, 2026
Copilot AI requested a review from asika32764 November 7, 2026 17:47
@asika32764

Copy link
Copy Markdown
Member

@copilot Try make ReactServer also supports middleware

Co-authored-by: asika32764 <1639206+asika32764@users.noreply.github.com>

Copilot AI commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Try make ReactServer also supports middleware

Added middleware execution and configuration APIs to ReactServer, with a regression test. Commit: 85985a6.

@asika32764
asika32764 marked this pull request as ready for review November 8, 2026 04:06
@asika32764
asika32764 merged commit 150efeb into master Nov 8, 2026
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.

[HTTP] bugs

2 participants