8000 fix(static): remove id from 404 `statusMessage` by pi0 · Pull Request #3338 · nitrojs/nitro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(static): remove id from 404 statusMessage #3338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 28, 2025
Merged

fix(static): remove id from 404 statusMessage #3338

merged 2 commits into from
Apr 28, 2025

Conversation

pi0
Copy link
Member
@pi0 pi0 commented Apr 28, 2025

Built-in serve static (since v2.6.0, #1459) uses (try/catch) decoding on original id. We use same id in statusMessage of 404 errors. It is not unsafe for real HTTP status message itself.

If a custom publicAssets entry is registered without fallthrough + a custom error renderer is used that uses statusMessage unsanitized in the HTML body, it can lead to security issues.

This PR omits extra status message (same fix for h3 1.x h3js/h3#1044).

Copy link
cloudflare-workers-and-pages bot commented Apr 28, 2025

Deploying nitrojs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 36d85fe
Status: ✅  Deploy successful!
Preview URL: https://c6842c14.nitrojs.pages.dev
Branch Preview URL: https://fix-encode-static-err.nitrojs.pages.dev

View logs

@pi0 pi0 changed the title fix: remove id from static 404 statusMessage fix(static): remove id from 404 statusMessage Apr 28, 2025
@pi0 pi0 merged commit dd3d5d0 into v2 Apr 28, 2025
5 checks passed
@pi0 pi0 deleted the fix/encode-static-err branch April 28, 2025 10:23
pi0 added a commit that referenced this pull request Apr 28, 2025
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.

1 participant
0