mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1892] [Issue]: storage commands accept unsupported collection names as new files #917
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#917
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 (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>.jsonfor 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, andstorage_deletepass caller-suppliedentityvalues intoFileStorage.validate_collection_nameonly checks that the name is non-empty and contains ASCII alphanumeric, dash, underscore, or dot characters.Steps to reproduce
storage_createwith an unsupported but syntactically valid entity name such astypo-collection.id.Expected: command rejects unsupported entity.
Actual from code inspection: the storage layer can create a matching JSON collection file.
Impact area
Environment
e546fdf2/api/invokeLogs, screenshots, or video
Static evidence:
src-tauri/crates/security/src/lib.rs:validate_collection_namechecks syntax only.src-tauri/crates/storage/src/lib.rs:collection_pathwrites undercollections/<collection>.jsonafter the syntax check.src-tauri/src/http_dispatch.rs: remotestorage_createreads caller-providedentityand passes it into storage.src-tauri/src/commands/storage/profile.rs: profile export/import has an explicitPROFILE_COLLECTIONSlist, 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