Skip to content

Moving a task to another project skips every permission check #472

Closed

Description

@caseysoftware

do_task_aed.php (L35) calls CTask::moveTaskBetweenProjects() whenever the posted new_task_project differs from the task's project. That method (tasks.class.php L2075):

  • rewrites task_project for the task and every subtask with direct queries (updateSubTasksProject()),
  • deletes the task's dependencies (removeDependencies()),
  • then calls store(), the first place a permission is checked.

The handler's load() result is ignored, and nothing checks edit rights on the task or add rights on the target project. So a logged-in user who can't edit a task (or can't even see it) can move it and its whole subtree into another project by posting its task_id with a different new_task_project. #463 (no module check before dosql) widens this to users without access to the Tasks module.

Fix: in the handler, stop when load() fails. In moveTaskBetweenProjects(), require canEdit() on the task and add permission on the target project before changing anything, and return an error instead of redirecting on refusal.

Found by reading the code on dev-5.0.0 @ 179b4eaf; not yet reproduced on a running install.

Blocks #488. Fix before Phase 0 of the REST API and MCP server proposal (#471).

Activity

  1. added
    api
    on Oct 23, 2026
  2. added a commit that references this issue on Oct 24, 2026
    27fcce2
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

    apimodule:taskssecurity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions