mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2390] [Issue]: 10-CONN-ERROR-config-url-and-provider-error-safety config fetches allow private URLs and unbounded error bodies #1178
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#1178
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 @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2390
Originally assigned to: @Promansis on GitHub.
Summary
Surface
10-CONN-ERROR-config-url-and-provider-error-safetyfrom #2384 has a confirmed parity gap. Refactor connection model/test config fetches allow private/local URLs by default and read provider responses before truncating.Expected behavior
Legacy config model/test fetches use outbound URL policy: allow loopback, block private/LAN/reserved targets unless the provider/image local URL opt-in allows them, validate redirects, cap response bytes, and sanitize provider HTML/error bodies.
Actual behavior
Refactor model/test URL checks call
is_allowed_outbound_url(url, true), which allows anyhttporhttpslocal/private target. Refactor redacts and truncates displayed errors, but model/test/image response paths read full.text()or.bytes()before truncation, so legacy response caps are missing.Steps to reproduce
10-CONN-ERROR-config-url-and-provider-error-safetyin #2384.safeFetchpolicy and caps against refactor Rust connection model/test helpers.Impact area
Environment
refactorparityscan, 2026-06-06Logs, screenshots, or video
Static proof only; no live provider request was made.
Legacy proof:
upstream/main:packages/server/src/routes/connections.routes.ts:106builds provider/image local URL policy with loopback allowed and private/local gated by env flags.upstream/main:packages/server/src/routes/connections.routes.ts:119normalizes image loopback test base URLs.upstream/main:packages/server/src/routes/connections.routes.ts:500,:632,:641usesafeFetchwith policy and 5 MiB caps for config model fetches.upstream/main:packages/server/src/utils/security.ts:309,:340,:372,:533validate outbound URLs/redirects and cap buffered/streaming responses.Refactor proof:
src-tauri/src/commands/storage/llm.rs:634,:866,:1060,:1389,:1404send connection/model fetch requests, allow local URLs, read full text, then sanitize displayed body.src-tauri/crates/security/src/lib.rs:83returns true for anyhttp/httpsURL whenallow_localis true.src-tauri/crates/llm/src/lib.rs:369,:1260,:1280,:4060allow local provider URLs and sanitize/redact provider errors after reading full text.src-tauri/src/commands/storage/images/providers.rs:441,:490,:602sanitize image provider errors after reading full text/bytes.Regression notes
Legacy
upstream/mainhas safer config URL policy and response caps. Refactor currently lacks those guards on this surface.Additional context
Linked tracker: #2384
Acceptance criteria:
10-CONN-ERROR-config-url-and-provider-error-safetyin fix notes or PR proof.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: