scratchfoundation / scratch-gui

Graphical User Interface for creating and running Scratch 3.0 projects.
https://scratchfoundation.github.io/scratch-gui/develop/
GNU Affero General Public License v3.0
4.5k stars 3.6k forks source link

Define Experimental Extension Policy #1124

Open kyleplo opened 6 years ago

kyleplo commented 6 years ago

With the adding of many new extensions, I think it would be a good idea to reconsider the experimental extension policy. I am proposing 3 options:

1.

Maybe you could display a warning when viewing projects with experimental extensions. image

2.

Add a way to submit extensions to make them official

3.

Allow users to enable experimental extensions in account settings. image

thisandagain commented 6 years ago

Thanks for raising this @kyleplo! We will absolutely be rethinking how this works for Scratch 3.0.

davidaylaian commented 6 years ago

How about in settings you can choose to enable extensions (similar to option 3), but you can decide which ones you want individually?

Kenny2github commented 6 years ago

Perhaps also make extensions more readily accessible (like maybe an “explore” tab for extensions)?

kyleplo commented 6 years ago

@davidaylaian I like that idea, except that there are so many experimental extensions that it would be hard to choose. But I guess, it could work like Chrome's permissions:

  1. A project requests to use an experimental extension
  2. If the user has never used that extension before, it will be blocked, but a warning will appear like this: image
  3. If the user has blocked the extension, no warning will appear and the extension will not run. They can re-enable it in their account settings.
  4. If they select "Run once", the extension will run that time, and the warning will display again the next time
  5. If they select "Run always", the extension will always run, unless they disable it with account settings
kyleplo commented 6 years ago

@Kenny2github I like that idea too!

davidaylaian commented 6 years ago

@kyleplo couldn't a malicious Scratch project trick people into installing a malicious extension, similar to how websites do with Chrome extensions? (Example) (Another Example)

These kinds of attacks are very common, and if adults fall for them, I can imagine kids programming on Scratch would accidentally install malware on their parents' computers. At the very least, I think that the run extension dialogue should only come up while the project isn't running.

TheBrokenRail commented 6 years ago

You could sandbox the extensions so they can only access certain things like util and args and not document and xmlhttprequest

CosmicWebServices commented 6 years ago

How about a review process for extensions and if the extension is not reviewed then it has that box to avoid people having to learn how to have a fallback when using extensions because people are to cautious to add an extension but still keep people safe.

kyleplo commented 6 years ago

In my opinion, the ideal solution would be:

CatsAreFluffy commented 6 years ago

How will running a block from a blocked extension work? Will it simply do nothing?

kyleplo commented 6 years ago

@CatsAreFluffy I think doing nothing might be the best option. Maybe giving users the choice of letting creators run their project without extensions would help, especially if the project required extensions. Then, users would be warned that the project needed extensions, but they weren't enabled.

hedgehog125 commented 6 years ago

Maybe users could confirm that the extensions are safe and also flag them for the Scratch Team to review?

hedgehog125 commented 6 years ago

I agree with @TheBrokenRail but don't forget: eval, webworkers, popups and alert, prompt ect.

hedgehog125 commented 6 years ago

What if a project using an extension got onto the front page (excluding recently shared)? Maybe the extension would have to be reviewed first? Edit: Maybe the extensions could have a "popularity" score, it could gain points in these ways:

When it reaches max popularity (Not sure how many points it would need) it goes onto a list for the Scratch Team to review, if there are front paged project(s) using it they won't be shown until the extension has been reviewed and confirmed safe)

TheBrokenRail commented 6 years ago

My idea is to sandbox the extension so the extension can't use prompt, eval, alert, XMLHttpRequest, WebSocket, document, location and pretty much everything in window. This could be done with a web worker.

Mrcomputer1 commented 6 years ago

@TheBrokenRail But XMLHttpRequest and WebSocket are useful to some extensions (like sending a request to a server on the user's computer to control a robot or doing cool things with external APIs like seeing if a Minecraft server is online (like one of my ScratchX extensions)).

hedgehog125 commented 6 years ago

@Mrcomputer1 Hmm... maybe you could use XMLHttpRequest and WebSocket as long as they weren't accessing the scratch website? But maybe GET requests are allowed?

hedgehog125 commented 6 years ago

Maybe projects should have a way of detecting if the extension was allowed? So it can display a message if the project needs it?

hedgehog125 commented 6 years ago

Maybe it could also display a similar message to when the 'username' block is used. Just make sure that when they log out all the cookies are cleared. Although prompt, eval, alert, document and webworkers would still have to be blocked.

hedgehog125 commented 6 years ago

Maybe it could be given a score of how dangerous it is? Based on how many of these features it uses and there could be a button to report it?

hedgehog125 commented 6 years ago

Hmmm... the problem with blocking these things is then it reduces the possibilities. If you were allowed iframes you could make a mini web browser or something.

hedgehog125 commented 6 years ago

Maybe there could be a way of putting elements on top of the canvas though? Then maybe a custom controller could be returned? (So that you can't move it off the canvas and to make it harder to trick the user into thinking it was created by the Scratch Team)

kyleplo commented 6 years ago

@hedgehog125 I think extensions should have a permissions array (like Chrome extensions) that provides a list of all the objects the extension needs to access. Users will get a warning based on the specific permissions:

hedgehog125 commented 6 years ago

@kyleplo hmmm, it's still not ideal though. Especially for younger kids.

TheBrokenRail commented 6 years ago

Allowing window would basically allow the extension to do anything like window.document and although using document would allow customization, you would easily be able to use it to change all links to a ad website for example and accessing history and location would server no purpose other than a redirect which could redirect to a fake website but otherwise great idea!

thisandagain commented 6 years ago

I'm going to lock this topic for now until we have time to discuss and develop a proposal. Thanks for all the input.