Skip to content

[flutter/dart] Is it possible to ask for permission for dangerous operations for Flutter contributors #186419

Closed

Description

@hellohuanlin

Use case

Background: #186412

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.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 12, 2026
  2. jtmcdole commented on May 13, 2026

    @jtmcdole
    Member

    #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.

  3. hellohuanlin commented on May 13, 2026

    @hellohuanlin
    ContributorAuthor

    #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.

    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.

  4. saurabh-mirajkar commented on May 13, 2026

    @saurabh-mirajkar
    Contributor

    @hellohuanlin Thanks for the proposal. Routing to team-tool to investigate further.

  5. added
    c: proposalA detailed proposal for a change to Flutter
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on May 13, 2026
  6. bkonyi commented on May 19, 2026

    @bkonyi
    Contributor

    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.

  7. added
    P3Issues that are less important to the Flutter project
    triaged-toolTriaged by Flutter Tool team
    on May 19, 2026
  8. jtmcdole commented on May 26, 2026

    @jtmcdole
    Member

    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 would break so many things.

  9. github-actions commented on Jul 14, 2026

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Jul 14, 2026
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

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions