Skip to content

Bug: WebDAV exposes project-scoped files at the tree root — listable, readable, and overwritable by any org member #2545

Closed

Description

@larryro

Problem

Project files (documents.projectId set) are being scoped to their owning project across the platform (Knowledge lists, @ pins, agent tools, mutations, RLS, REST — see the fix project file scope PR from branch worktree-fix-project-file-scope). The WebDAV surface was deliberately left out of that change because its collision/move/copy semantics need their own regression cycle — this issue tracks it.

Current behaviour

Project uploads carry no folderId (app/features/projects/components/project-files-tab.tsx upload path), so WebDAV treats them as root-level hub documents. Any org member with an app password can:

  • List them: convex/webdav/tree_queries.ts listCollection (~L121-132) filters documents on lifecycle only.
  • Read them: leaf resolution by title (tree_queries.ts ~L362-390) resolves project docs for GET.
  • Overwrite them: convex/webdav/tree_mutations.ts ingestPutBlob (~L149) resolves the PUT target by (org, title, folder) name collision — a PUT with a colliding name replaces the project file's blob.
  • Delete/move/copy them: softDeleteDocument, moveResource, copyResource have no project gate; the name-collision lookups (~L626, ~L737, ~L851, ~L900) also see project docs.

WebDAV intentionally applies no team ACLs (documented Hono-trust split in convex/webdav/README.md), but project files are meant to be hard-scoped — they are not hub rows.

Proposed change

Make WebDAV a hub-only surface, consistent with REST (documents/rest_api.ts after the scope fix):

  • Exclude projectId docs from listCollection, leaf/props resolution, and every name-collision lookup (visibility predicate = active AND not project-scoped — reuse isProjectScopedDocument from convex/documents/access.ts).
  • Deny ingestPutBlob / softDeleteDocument / moveResource / copyResource when the resolved target is project-scoped (behave as not-found, mirroring the REST 404s).
  • Mind PUT-collision semantics: a PUT whose name collides with an invisible project doc must create a new hub doc, not bind to the project row.

Acceptance criteria

  • PROPFIND on the root does not list project-scoped documents.
  • GET/PUT/DELETE/MOVE/COPY addressing a project file's path behaves as not-found and never mutates the project doc's row or blob.
  • A PUT whose filename collides with a project file creates an independent hub document.
  • Regression tests in tree_queries/tree_mutations suites cover list, GET-resolve, PUT-collision, delete, and move against a seeded project doc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: highsecurityservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions