[GH-ISSUE #2433] [Issue]: 11-PROV-ERROR-url-secret-redaction-policy image/TTS provider URL safety gap #1190

Closed
opened 2026-10-21 05:28:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2433

Originally assigned to: @SpicyMarinara on GitHub.

Summary

11-PROV-ERROR-url-secret-redaction-policy: refactor image and TTS provider transports do not consistently enforce the outbound URL safety policy that legacy applied through safeFetch.

Expected behavior

Live provider requests should block private, LAN, metadata, reserved, and unsafe outbound URLs unless the relevant local-provider flag explicitly allows them. Provider errors and diagnostics should remain redacted.

Actual behavior

Refactor LLM/model paths have URL policy and redaction controls, but image and TTS provider paths build raw reqwest::Clients and send configured baseUrl or returned image URLs without the same URL validation. This leaves image/TTS provider calls with weaker URL safety than legacy.

Steps to reproduce

  1. Inspect Target 11 surface 11-PROV-ERROR-url-secret-redaction-policy from #2410.
  2. Compare legacy image/TTS provider calls using safeFetch against refactor image/TTS Rust provider calls.
  3. Note that refactor LLM/model paths enforce URL policy, while image/TTS paths send via raw reqwest::Client.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor parityscan, Target 11 batch 8
  • Run mode: Tauri desktop / remote runtime provider transport
  • OS + version: not relevant; static trace
  • Node + pnpm versions: not relevant; static trace
  • Rust version, if relevant: not collected
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: image generation providers and TTS providers

Logs, screenshots, or video

Proof used: static trace only; no live provider calls and no real secrets.

Legacy behavior:

  • main:packages/server/src/services/image/image-generation.ts:28 imports safeFetch.
  • main:packages/server/src/services/image/image-generation.ts:249 routes image provider fetch through safeFetch with local URL policy.
  • main:packages/server/src/routes/tts.routes.ts:17 imports safeFetch.
  • main:packages/server/src/routes/tts.routes.ts:445, :498, and :632 route TTS voice/speech provider fetches through safeFetch with local URL policy.

Refactor behavior:

  • src-tauri/crates/security/src/lib.rs:83 and :99 contain shared outbound URL checks.
  • src-tauri/crates/llm/src/lib.rs:395 validates LLM provider URLs before constructing the client, with negative-control tests at :4767, :4778, and :4896.
  • src-tauri/src/commands/storage/llm.rs:1491 validates model URLs, with credential/redaction tests at :2200 and :2265.
  • src-tauri/src/commands/storage/images/providers.rs:276 accepts image baseUrl, but provider calls use raw clients at :429, :690, and :722.
  • src-tauri/src/commands/storage/integrations/tts.rs:230, :355, and :605 build raw clients for TTS voice/speech calls; redaction is covered for one provider-error path at :1021.

Regression notes

Legacy used the shared safeFetch URL policy for the same image and TTS provider surfaces. Refactor preserves stronger LLM/model safety, but the image/TTS transport owner paths do not consistently apply it.

Additional context

Source tracker: #2410.

Acceptance criteria:

  • Image provider HTTP calls validate configured provider URLs and provider-returned downloadable image URLs against a shared outbound URL policy.
  • TTS voice and speech provider HTTP calls validate configured provider URLs against the same policy or a TTS-specific equivalent.
  • Local/private URL allow behavior remains explicit and provider-scoped, including local image/TTS backends that are intentionally supported.
  • Provider error messages and details remain redacted; add negative controls for blocked private/reserved URLs and redacted provider bodies.
  • 11-PROV-ERROR-url-secret-redaction-policy can be rescanned as no-gap for image, TTS, and LLM/model safety paths.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2433 Originally assigned to: @SpicyMarinara on GitHub. ## Summary `11-PROV-ERROR-url-secret-redaction-policy`: refactor image and TTS provider transports do not consistently enforce the outbound URL safety policy that legacy applied through `safeFetch`. ## Expected behavior Live provider requests should block private, LAN, metadata, reserved, and unsafe outbound URLs unless the relevant local-provider flag explicitly allows them. Provider errors and diagnostics should remain redacted. ## Actual behavior Refactor LLM/model paths have URL policy and redaction controls, but image and TTS provider paths build raw `reqwest::Client`s and send configured `baseUrl` or returned image URLs without the same URL validation. This leaves image/TTS provider calls with weaker URL safety than legacy. ## Steps to reproduce 1. Inspect Target 11 surface `11-PROV-ERROR-url-secret-redaction-policy` from #2410. 2. Compare legacy image/TTS provider calls using `safeFetch` against refactor image/TTS Rust provider calls. 3. Note that refactor LLM/model paths enforce URL policy, while image/TTS paths send via raw `reqwest::Client`. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [x] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor parityscan, Target 11 batch 8 - Run mode: Tauri desktop / remote runtime provider transport - OS + version: not relevant; static trace - Node + pnpm versions: not relevant; static trace - Rust version, if relevant: not collected - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: image generation providers and TTS providers ## Logs, screenshots, or video Proof used: static trace only; no live provider calls and no real secrets. Legacy behavior: - `main:packages/server/src/services/image/image-generation.ts:28` imports `safeFetch`. - `main:packages/server/src/services/image/image-generation.ts:249` routes image provider fetch through `safeFetch` with local URL policy. - `main:packages/server/src/routes/tts.routes.ts:17` imports `safeFetch`. - `main:packages/server/src/routes/tts.routes.ts:445`, `:498`, and `:632` route TTS voice/speech provider fetches through `safeFetch` with local URL policy. Refactor behavior: - `src-tauri/crates/security/src/lib.rs:83` and `:99` contain shared outbound URL checks. - `src-tauri/crates/llm/src/lib.rs:395` validates LLM provider URLs before constructing the client, with negative-control tests at `:4767`, `:4778`, and `:4896`. - `src-tauri/src/commands/storage/llm.rs:1491` validates model URLs, with credential/redaction tests at `:2200` and `:2265`. - `src-tauri/src/commands/storage/images/providers.rs:276` accepts image `baseUrl`, but provider calls use raw clients at `:429`, `:690`, and `:722`. - `src-tauri/src/commands/storage/integrations/tts.rs:230`, `:355`, and `:605` build raw clients for TTS voice/speech calls; redaction is covered for one provider-error path at `:1021`. ## Regression notes Legacy used the shared `safeFetch` URL policy for the same image and TTS provider surfaces. Refactor preserves stronger LLM/model safety, but the image/TTS transport owner paths do not consistently apply it. ## Additional context Source tracker: #2410. Acceptance criteria: - Image provider HTTP calls validate configured provider URLs and provider-returned downloadable image URLs against a shared outbound URL policy. - TTS voice and speech provider HTTP calls validate configured provider URLs against the same policy or a TTS-specific equivalent. - Local/private URL allow behavior remains explicit and provider-scoped, including local image/TTS backends that are intentionally supported. - Provider error messages and details remain redacted; add negative controls for blocked private/reserved URLs and redacted provider bodies. - `11-PROV-ERROR-url-secret-redaction-policy` can be rescanned as no-gap for image, TTS, and LLM/model safety paths. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:28:33 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Fixed in refactor with commit 8cd200c4.

Behavior changed:

  • Image provider base URLs now validate through the shared outbound provider URL policy before dispatch.
  • Provider-returned/downloadable image URLs are validated before fetch, with explicit local allowance only where the local image backend is the source.
  • TTS voice lookup and speech URLs now validate through the same provider URL policy before dispatch.
  • PocketTTS and local image backends keep explicit provider-scoped local behavior; other private/reserved targets require the dedicated env override.
  • Blocked URL errors redact secrets before surfacing fallback/provider metadata.

Verification:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine metadata -- --nocapture
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • pnpm check:architecture
<!-- gh-comment-id:4638190998 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Fixed in refactor with commit 8cd200c4. Behavior changed: - Image provider base URLs now validate through the shared outbound provider URL policy before dispatch. - Provider-returned/downloadable image URLs are validated before fetch, with explicit local allowance only where the local image backend is the source. - TTS voice lookup and speech URLs now validate through the same provider URL policy before dispatch. - PocketTTS and local image backends keep explicit provider-scoped local behavior; other private/reserved targets require the dedicated env override. - Blocked URL errors redact secrets before surfacing fallback/provider metadata. Verification: - cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine metadata -- --nocapture - cargo check --manifest-path src-tauri/Cargo.toml --workspace - pnpm check:architecture
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1190
No description provided.