Repository navigation
Conversation
…not the root folder
getFileContentsInternal() resolved a task's file id with
IRootFolder::getFirstNodeById(), which is not scoped to a user. Through
the per-user path cache or the first-mount fallback of
Root::getByIdInPath() it can return the node in another user's home, so
a task kept serving its input file after the user's access to it was
removed. The lookup now goes through getUserFolder($task->getUserId()),
so only what the task's user can reach right now is found. Output
files in app data are still served by the existing fallback lookup,
also when the task has no user or its user is gone.
The helper is shared by the user route (tasks/{taskId}/file/{fileId})
and the ExApp route (tasks_provider/{taskId}/file/{fileId}), so both
are covered. Manager::validateFileId() keeps its root lookup because
its callers for input files call validateUserAccessToFile() on the
same id.
An input file that the task's own user moved to the trash bin is no
longer served (404), consistent with the synchronous provider path.
Assisted-by: OpenCode:glm-5.3-flash
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
julien-nc
requested review from
Altahrim and
salmart-dev
and removed request for
a team
November 27, 2026 11:19
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
marcelklehr
approved these changes
Nov 27, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TaskProcessingApiController::getFileContentsInternal()resolved a task's file id withIRootFolder::getFirstNodeById(), which is not scoped to a user. Through the per-user path cache or the first-mount fallback ofRoot::getByIdInPath(), that lookup can return the node in another user's home, so a task kept serving its input file after the task's user had lost access to it.The lookup now goes through
getUserFolder($task->getUserId())->getFirstNodeById(), so only what the task's user can reach right now is found. Output files in app data are still served by the existing fallback lookup, also when the task has no user or its user is gone (NoUserExceptionis caught).The helper is shared by the user route (
tasks/{taskId}/file/{fileId}) and the ExApp route (tasks_provider/{taskId}/file/{fileId}), so both are covered.Behavior change
An input file that the task's own user moved to the trash bin is no longer served (404 instead of 200), consistent with the synchronous provider path, where
Manager::fillInputFileData()re-checks access before reading the input.Testing
tests/Core/Controller/TaskProcessingApiControllerTest.php(7 tests): file in the task user's folder, file the user has no access to (404), output file in app data for both routes, and the deleted-user case on the ExApp route. All tests fail before this change and pass after it.Assisted by OpenCode:glm-5.3-flash
Checklist
3. to review, feature component)stable32)AI (if applicable)