Skip to content

fix: scope Materialious account operations and logout cookie - #2

Draft
Cylac wants to merge 12 commits into
mainfrom
fix/m1-account-boundaries
Draft

Cylac wants to merge 12 commits into
mainfrom
fix/m1-account-boundaries

Conversation

@Cylac

@Cylac Cylac commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Prepare a small, reviewable security hardening patch discovered while verifying the unmodified Materialious Full baseline for a private family deployment.

Changes

  • Scope subscription lookup, deletion, and listing to the current immutable user ID.
  • Return explicit HTTP 401 for anonymous subscription collection and item routes.
  • Match the cookie deletion path to the existing login cookie path.
  • Add focused Node tests that execute the current TypeScript code against in-memory dependency stubs. Include these tests in the existing web pull-request checks.

Validation and rollout boundaries

  • A controlled ownership-probe using only a disposable copy of the existing test database reproduced the missing owner predicate in baseline 1.18.35. The scratch copy was deleted after the test. No live records were changed.
  • Web CI verified: GitHub Actions passed the M1 regression tests, Svelte checks, ESLint and full application build on commit 594131de9e36a0133716c8f08ac5b2fffcc89201. Browser-level multi-account and logout acceptance tests are still pending.
  • This PR is draft, targets the fork's main branch, and does not deploy to any server or modify the existing M1 runtime. Full endpoint/browser verification remains to be completed before any merge or rollout.
  • This is an independent fork change, not an upstream Materialious support request.

Considerations

This is a minimal baseline authorization correction, separate from the OIDC work in PR #1. Existing account passwords, encryption format and current authentication mechanisms are unchanged. The legacy signed user token remains nonrevocable until a separately reviewed session design is introduced.

Focused regression validation, November 24, 2026

  • Six Node tests executed against the actual patched TypeScript source, using controlled in-memory database stubs: 6 passed, 0 failed.
  • The same six tests were run against the exact unmodified upstream 1.18.36 source: 0 passed, 6 failed, confirming a useful red/green regression signal.
  • Database-level ownership probe reproduced the baseline predicate issue using a scratch copy of disposable M1 data, which was deleted after the test. The live database and account were not changed.
  • An application-consistent SQLite backup of the running baseline was restored to a separate file and passed integrity/foreign key checks. Full encrypted account login against the restored copy remains untested.
  • CI update: After workflows were enabled, the web pipeline passed on run 45470328269. Authenticated end-to-end and cross-user browser tests remain outstanding.
  • The installed family pilot remains on unmodified 1.18.35; this draft patch is not deployed or merged.

Additional database integration coverage

Added materialious/tests/m1-database-ownership.test.cjs to the feature branch. It uses a real in-memory SQLite database and the current Sequelize association layout to check per-user subscription listings, existence checks and deletion. The web PR workflow is configured to execute both M1 test files.

Validation state, November 24: The initial 7 M1 regression tests passed with 0 failures in a disposable Node 26.13.1 Docker test environment pinned to source commit f6a8fab3, including a real Sequelize/in-memory SQLite ownership test. An additional cross-account RSS timestamp assertion was added. Following a targeted CommonJS lint exception for the two test files, GitHub's full Check web job passed its dependency installation, M1 tests, Svelte validation, linting and production build on commit 594131de9. This validates the project-declared dependency installation in CI, unlike the earlier isolated harness. Desktop and Android workflows have separate jobs and are not counted as a web pass. Browser-level multi-account/logout verification remains outstanding. The PR remains draft and unmerged; the installed family pilot is unchanged.

Viewing history authorization checkpoint, November 24, 2026

Current upstream src/routes/api/user/history/+server.ts was reviewed. Its history DELETE endpoint had no explicit anonymous access check (the GET and POST endpoints already do). Commit 7dde6138a8 adds a 401 guard and two focused route-handler tests using disposable simulated users. They verify anonymous rejection before database access and that one user's history listing and deletion remain scoped to their ID. These are route-level simulated-authentication tests, not browser, real-cookie, or end-to-end tests.

New web CI: SUCCESS, run 45471052355, including Node tests, Svelte checks, ESLint and full production build on commit 7dde6138a8be90e1c789f5102f6a7c97e9bf75d8.

A separate functional issue was observed in upstream: updating an existing history entry omits progress from the update payload. This merits isolated verification and a separate fix, not an unreviewed extension to this authorization PR. Authenticated two-account browser checks, session/logout behaviour and encrypted-data recovery are still outstanding. The PR remains draft/unmerged and is not deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant