Skip to content

ui: DELETE /api/project leaves a zombie watch (deleted project resurrects) #803

Description

@DeusData

Follow-up from the #537 review. #537 fixed the MCP delete_project path (now unwatches, with deferred free). The UI HTTP server has a second production deletion path — DELETE /api/project in src/ui/http_server.c (~:993-1024) unlinks the .db but has no watcher access at all — so a project deleted via the UI still gets auto-reindexed by its live watch entry, recreating the DB (the resurrection bug), same class as #537.

Fix shape: route the UI delete through the same unwatch (+ deferred free) that handle_delete_project now uses. Also from the #537 review: the realloc-failure fallback in cbm_watcher_unwatch frees immediately, reintroducing the cross-thread UAF in the OOM corner — worth hardening in the same pass.

Activity

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

    bugSomething isn't workingpriority/normalStandard review queue; useful PR with ordinary maintainer urgency.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions