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
[flutter/dart] Is it possible to ask for permission for dangerous operations for Flutter contributors #186419
It is scary that a random Flutter script can nuke folders like ~/Desktop. The damage is real - in my case, I lost my repos (with a few local branches that I didn't push), but it could have been worse for other contributors.
Proposal
I wonder if it is possible to limit what flutter/dart can do, and explicitly ask for permission for dangerous operations like this. As a flutter contributor, I'd appreciate this kind of protection.
I think it should just create a new, temporary folder in the target folder, and clean that up.
While this is definitely a script issue, I think it also highlights a broader security risk. Adding an extra layer of safety within flutter/dart tooling itself would protect users and CI systems from similar, potentially catastrophic file-system accidents caused by other scripts down the road.
In theory, this is something that we can try and do. We can setup IOOverrides for the test environment and ensure that all file system operations occur under $TMP. I'm not sure if that would have any unintended consequences or not.
The only way to be completely safe would be to run everything in a proper sandbox.
I think it also highlights a broader security risk.
Running native code is always a security risk. While Ben's work is adding some guardrails, anyone can create a pr that removes them and tries to run code outside of the project/test (hence the CICD label).
I wonder if it is possible to limit what flutter/dart can do, and explicitly ask for permission for dangerous operations like this. As a flutter contributor, I'd appreciate this kind of protection.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
jtmcdole commentedon May 13, 2026
#186412 is not a tool issue, its a script issue in flutter/dev/devicelab/bin/tasks/module_uiscene_test_ios.dart
I think it should just create a new, temporary folder in the target folder, and clean that up.
hellohuanlin commentedon May 13, 2026
While this is definitely a script issue, I think it also highlights a broader security risk. Adding an extra layer of safety within flutter/dart tooling itself would protect users and CI systems from similar, potentially catastrophic file-system accidents caused by other scripts down the road.
saurabh-mirajkar commentedon May 13, 2026
@hellohuanlin Thanks for the proposal. Routing to
team-toolto investigate further.bkonyi commentedon May 19, 2026
In theory, this is something that we can try and do. We can setup
IOOverridesfor the test environment and ensure that all file system operations occur under$TMP. I'm not sure if that would have any unintended consequences or not.The only way to be completely safe would be to run everything in a proper sandbox.
[flutter_tools, devicelab] Fix filesystem safety guard unit test inte…
[flutter_tools, devicelab] Fix filesystem safety guard unit test inte…
[flutter_tools, devicelab] Fix filesystem safety guard unit test inte…
[flutter_tools, devicelab] Add safety filesystem guard to tests
[flutter_tools, devicelab] Fix filesystem safety guard unit test inte…
jtmcdole commentedon May 26, 2026
Running native code is always a security risk. While Ben's work is adding some guardrails, anyone can create a pr that removes them and tries to run code outside of the project/test (hence the CICD label).
This would break so many things.
[flutter_tools, devicelab] Address review comments for filesystem guard
[flutter_tools, devicelab] Add safety filesystem guard to tests (flut…
[flutter_tools, devicelab] Add safety filesystem guard to tests (flut…
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.