microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.04k stars 29.21k forks source link

[security] OS-level readwrite sandboxing for filesystem readwrites #180233

Closed zm-cttae closed 11 months ago

zm-cttae commented 1 year ago

Problem statement

This feature request is part of an "epic" suggestion in https://github.com/microsoft/vscode/issues/52116#issuecomment-1435163979 This feature request also replaces (supersedes) #174715

Proposed solution

An OS level transparent sandbox makes more sense (like Chromium does), as it won't require changing the code completely if it doesn't access anything it is not supposed to, or just add the small amount of additional stuff it does need.

Implementation details

This will prevent extensions from modifying system files and other files with semi-locked or locked chmod permissions.

Changes would apply to require("fs") and vscode.workspace.fs. That way we could officially use /c/Program Files or /usr/bin with native APIs.

Proposed changeset

vscodenpa commented 1 year ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vscodenpa commented 1 year ago

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

zm-cttae commented 1 year ago

Added a proposed changeset now that this has 20 upvotes! 🥳🎉 please critique or add suggestions

dudicoco commented 1 year ago

What about network access restrictions?

zm-cttae commented 1 year ago

Interesting. Do you have any user story or problem statement there?

dudicoco commented 1 year ago

@zm-cttae yes, an extension could perform malicious actions using network calls:

  1. download a malicious file and run it
  2. send your code over to a malicious actor
vscodenpa commented 11 months ago

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!