Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

Deferred security/correctness items from #46 #55

Description

@LiukScot

Deferred security/correctness items captured during review of #46. Each is documented with file:line, severity, patch sketch, and required test in the PR body.

  • HIGH — Authorization bypass via ancestor-cycle in PATCH /pages/:id parentPageIdapps/server/src/routes/pages.ts:199-201. Walk ancestor chain before accepting reparent.
  • HIGH — sortOrder race conditionapps/server/src/routes/pages.ts:113, apps/server/src/routes/databases.ts:104-135. Move getNextSortOrder() inside the tx.
  • MEDIUM — File upload magic-byte validationapps/server/src/routes/pages.ts:220-278. Validate uploaded image bytes with file-type.
  • MEDIUM — Cell upsert lacks composite primary keyapps/server/src/routes/databases.ts:503-525, apps/server/src/db/schema.ts:79-87. Add composite PK (row_id, property_id) + onConflictDoUpdate.
  • MEDIUM — CORS allows non-browser origins unconditionallyapps/server/src/index.ts:27-28. Return null to deny instead of falsy.

Full patches + decision notes in PR body of #46.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions