Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 2.39 KB

SECURITY.md

File metadata and controls

42 lines (27 loc) · 2.39 KB

How the security works

We are scanning all 3rd party app code for various things they shouldn’t use directly. There are two scans, one is text-based, another is AST based. (Pretty much denies creating actors and running functions that are named setCertifiedData, cyclesAdd, and so on.) It scans all libraries an app imports including the base libraries.

One of the problems is, there are two base libraries that provide allowed functionality but trigger the security checks. These are “Principal.mo” and “Random.mo”. So we’ve whitelisted their hashes from the last 23 Motoko base releases.

Unless there is a way for Motoko code to jailbreak that I don’t know of, I suppose this should work?

Text checks:

image

AST checks: image

Developers get notified when they use prohibited code image

These apps get assembled based on a json config. The generated actor code with all apps looks like this: (anti-injection & collision checks are done by the generator) image

(Devs get working type checks going on while developing, even with multiple apps.) Neutron.json config: image

Apps look like this: image

Additionally, apps get bundled like this (It’s not a good idea to include the huge .mops folders inside the frontend) All these apps share the same modules if their hashes match. (This reduced the wasm size by 5kb, I am assuming either we have a bug, or Motoko is not doing that kind of optimization when libraries import the same file (same imports included) from different folders)

image

When a user tries to install an app they see a dialog with the permissions it requires: image

or

image