[GH-ISSUE #1892] [Issue]: storage commands accept unsupported collection names as new files #917

Closed
opened 2026-10-21 05:23:26 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Summary

Generic storage commands accept any syntactically safe collection name and can create data/collections/<entity>.json for unsupported entities. The low-level validator prevents path escapes, but it does not check that the entity is part of the supported storage surface.

Expected behavior

Storage commands should reject unsupported collection/entity names, or route extension-owned collections through an explicit registry/opt-in path.

Actual behavior

storage_list, storage_get, storage_create, storage_update, and storage_delete pass caller-supplied entity values into FileStorage. validate_collection_name only checks that the name is non-empty and contains ASCII alphanumeric, dash, underscore, or dot characters.

Steps to reproduce

  1. Call storage_create with an unsupported but syntactically valid entity name such as typo-collection.
  2. Supply a small object with an id.
  3. Inspect storage data after the command.

Expected: command rejects unsupported entity.
Actual from code inspection: the storage layer can create a matching JSON collection file.

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: current refactor checkout, e546fdf2
  • Run mode: Tauri desktop or remote runtime storage command
  • OS + version: not captured
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? relevant when called through /api/invoke
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Static evidence:

  • src-tauri/crates/security/src/lib.rs: validate_collection_name checks syntax only.
  • src-tauri/crates/storage/src/lib.rs: collection_path writes under collections/<collection>.json after the syntax check.
  • src-tauri/src/http_dispatch.rs: remote storage_create reads caller-provided entity and passes it into storage.
  • src-tauri/src/commands/storage/profile.rs: profile export/import has an explicit PROFILE_COLLECTIONS list, so unsupported ad hoc collections can fall outside normal profile handling.

Regression notes

Legacy file-native storage used a fixed table list and schema metadata. Unsupported tables were rejected by metadata lookup instead of becoming new persisted files.

Additional context

Suggested fix: add an allowlist/registry at the storage command boundary and/or inside the Rust storage crate. If extension-owned collections are intended, require explicit registration so profile export, import, deletion, and backup behavior stays visible.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1892 Originally assigned to: @Promansis on GitHub. ## Summary Generic storage commands accept any syntactically safe collection name and can create `data/collections/<entity>.json` for unsupported entities. The low-level validator prevents path escapes, but it does not check that the entity is part of the supported storage surface. ## Expected behavior Storage commands should reject unsupported collection/entity names, or route extension-owned collections through an explicit registry/opt-in path. ## Actual behavior `storage_list`, `storage_get`, `storage_create`, `storage_update`, and `storage_delete` pass caller-supplied `entity` values into `FileStorage`. `validate_collection_name` only checks that the name is non-empty and contains ASCII alphanumeric, dash, underscore, or dot characters. ## Steps to reproduce 1. Call `storage_create` with an unsupported but syntactically valid entity name such as `typo-collection`. 2. Supply a small object with an `id`. 3. Inspect storage data after the command. Expected: command rejects unsupported entity. Actual from code inspection: the storage layer can create a matching JSON collection file. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [x] Chat mode - [x] Roleplay mode - [x] 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 - [x] 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: current refactor checkout, `e546fdf2` - Run mode: Tauri desktop or remote runtime storage command - OS + version: not captured - Node + pnpm versions: not relevant - Rust version, if relevant: not captured - Remote Runtime URL configured? relevant when called through `/api/invoke` - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Static evidence: - `src-tauri/crates/security/src/lib.rs`: `validate_collection_name` checks syntax only. - `src-tauri/crates/storage/src/lib.rs`: `collection_path` writes under `collections/<collection>.json` after the syntax check. - `src-tauri/src/http_dispatch.rs`: remote `storage_create` reads caller-provided `entity` and passes it into storage. - `src-tauri/src/commands/storage/profile.rs`: profile export/import has an explicit `PROFILE_COLLECTIONS` list, so unsupported ad hoc collections can fall outside normal profile handling. ## Regression notes Legacy file-native storage used a fixed table list and schema metadata. Unsupported tables were rejected by metadata lookup instead of becoming new persisted files. ## Additional context Suggested fix: add an allowlist/registry at the storage command boundary and/or inside the Rust storage crate. If extension-owned collections are intended, require explicit registration so profile export, import, deletion, and backup behavior stays visible. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:23:26 +07:00
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#917
No description provided.