-
Notifications
You must be signed in to change notification settings - Fork 67
Restrict in-frame navigation for dapps #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the network dapps PR is merged, wouldn't it be enough to:
- shell.openExternal if it starts with http
- else append appId (if not existent)?
electron/index.js
Outdated
@@ -18,6 +18,7 @@ const electron = require('electron'); | |||
const fs = require('fs'); | |||
const path = require('path'); | |||
const url = require('url'); | |||
const { URL, URLSearchParams } = url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { format, URL, URLSearchParams} = require('url')
, or put this line under all the requires.
The linter doesn't yell here, but I think it's one of the rules to first import then const ..., so let's apply it here too.
The dapp could then display files from the filesystem in the same frame (incl. other dapps) This could be an attack vector: if good dapp was compromised and redirects the user to the filesystem location of a malicious network dapp (already fetched), then electron would pass the appId of good dapp to the malicious dapp, and malicious dapp would have the permissions of good dapp |
* Restrict in-frame navigation for dapps * Lint
* Download network (registry) dapps and load them from filesystem * Remove obsolete Rust files * package-lock.json * Linting * Fix tests * Lint * Fix .includes() is not a function (:88) * Remove rust files from CI build * Update @parity/ui dependency * Grumbles * Restrict in-frame navigation for dapps (#146) * Restrict in-frame navigation for dapps * Lint * Grumbles * fs-extra pathExists doesn't throw if the path doesn't exist * Fix bug uglifyjs
Closes #118
?appId
when navigating to other files of the dapp (allows multi-page dapps to use the api; prevent appId spoofing)