mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3661] [CLOSED] fix(security): handle missing content-type and gzip responses in safeFetch JSON paths #6043
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6043
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3661
Author: @Lamboozled
Created: 7/15/2026
Status: ❌ Closed
Base:
main← Head:fix/safefetch-compressed-json-responses📝 Commits (3)
790da41chore: start v2.3.1 developmentd4114deMerge pull request #3659 from Pasta-Devs/agent/start-v2.3.12d8542dfix(security): handle missing content-type and gzip in safeFetch JSON paths📊 Changes
14 files changed (+24 additions, -15 deletions)
View changed files
📝
CHANGELOG.md(+7 -0)📝
README.md(+1 -1)📝
android/app/build.gradle(+3 -3)📝
package.json(+1 -1)📝
packages/client/package.json(+1 -1)📝
packages/client/public/manifest.json(+1 -1)📝
packages/server/package.json(+1 -1)📝
packages/server/src/services/bot-browser/fetch-json.ts(+1 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+1 -0)📝
packages/server/src/utils/security.ts(+1 -1)📝
packages/shared/package.json(+1 -1)📝
packages/shared/src/constants/defaults.ts(+1 -1)📝
win/installer/install.bat(+2 -2)📝
win/installer/installer.nsi(+2 -2)📄 Description
Linked issue
Closes #3660
Why this change
safeFetch'sallowedContentTypesguard used!contentType ||which rejects responses that omit theContent-Typeheader entirely, even when the body is valid content. Card browser API calls (fetchBotBrowserJson) and the capability package catalog both hit this, logging "Outbound response content type is not allowed: " on startup and during browsing.readCappedResponsereads the raw response byte stream viaresponse.body.getReader(), bypassing undici's built-inContent-Encodingdecompression. GitHub raw content (capability catalog) and some card browser APIs return gzip-compressed responses, causingresponse.json()to throw aSyntaxErrorwith raw gzip bytes.What changed
packages/server/src/utils/security.ts— change!contentType ||tocontentType &&in theallowedContentTypesguard so only explicitly wrong content types are rejected; missing headers are allowed throughpackages/server/src/services/bot-browser/fetch-json.ts— adddecodeCompressedResponse: trueso gzip API responses are decompressed before parsingpackages/server/src/services/capability-packages/package-manager.service.ts— adddecodeCompressedResponse: trueto the catalog fetch for the same reasonValidation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Docs and release impact
Summary by CodeRabbit
Release
Bug Fixes
content-typeheader are now handled correctly when content-type validation is enabled.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.