You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Moving a task to another project skips every permission check #472
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.
Activity
Tasks: check permissions before moving a task to another project