mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3617] [Issue]: Bot Browser JSON proxies duplicate uncapped fetch logic outside safeFetch #1957
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#1957
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?
Originally created by @Xelvanis on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3617
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The Chub, CharacterTavern, and Wyvern Bot Browser route modules each contain the same plain-
fetch()JSON proxy helper instead of using Marinara's existingsafeFetchoutbound-request boundary. The helpers have a timeout, but no response-size cap and no Marinara-controlled redirect/DNS policy.This is both duplicated maintenance logic and an outbound-fetch hardening gap. The initial API origins are fixed constants, so this is not a direct arbitrary-URL SSRF report; the concrete risks are uncapped JSON buffering, weaker redirect handling, and future fixes drifting across the three copies.
Expected behavior
safeFetchpolicy.Actual behavior
Identical
proxyFetch()implementations exist independently in three route files. Each helper:AbortControllertimeout.fetch().res.json(), buffering and parsing the complete successful body without a response-size cap.The same route modules already use
safeFetchfor avatar requests, so Bot Browser traffic currently has two different outbound safety paths depending on whether the response is JSON or an image.safeFetchalready provides private/reserved-address rejection, redirect revalidation, cross-origin sensitive-header stripping, protocol restrictions, and a default 10 MB response cap. It does not currently expose an exact provider-host allowlist, so consolidation should not be a blind text replacement: permitted hosts/redirects and suitable limits need to be decided for each provider.Steps to reproduce
proxyFetch()definitions in the Chub, CharacterTavern, and Wyvern route modules; the bodies are identical.res.json()with no response-size limit, so the complete body is buffered and parsed.fetch()behavior rather than Marinara'ssafeFetchredirect and resolved-address validation.Runtime reproduction with a controlled upstream was not performed for this report. The duplicate helpers, plain-fetch path, and absence of a response-size policy were verified by static inspection of current
staging.Environment
stagingat694bc88f16bd99838aa52b70bd07b56fe9e354e4(2026-07-15)Logs, screenshots, or video
None. This report is based on static inspection; no controlled-upstream runtime logs or screenshots were captured.
Additional context
Duplicate helpers:
proxyFetch()proxyFetch()proxyFetch()Existing shared boundary:
safeFetchsafeFetchsafeFetchSuggested remediation:
fetchBotBrowserJson()helper built onsafeFetch.Related but not duplicate:
This issue is scoped first to the three identical JSON helpers. Other direct raw-fetch paths in the Bot Browser modules handle different payloads or authentication and should be evaluated separately rather than mechanically folded into the same abstraction.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 14, 2026):
Ownership: @SpicyMarinara is addressing this in
fix/3616-3625-open-issues. A staging-targeted draft PR will be linked as soon as the first reproducible fix is committed.@SpicyMarinara commented on GitHub (Jul 14, 2026):
Draft implementation PR is now open: #3626. It remains draft while the linked regression lanes are implemented and validated.
@SpicyMarinara commented on GitHub (Jul 14, 2026):
Addressed in ready-for-review PR #3626 targeting staging. The fix and regression coverage have been pushed and validated locally.