-
-
Notifications
You must be signed in to change notification settings - Fork 192
chore: tighten up REPL security #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
bind:this={repl} | ||
{svelteUrl} | ||
{relaxed} | ||
can_escape | ||
injectedJS={mapbox_setup} | ||
showModified | ||
showAst | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,6 +18,8 @@ | |||||||||
export let status: string | null; | ||||||||||
/** sandbox allow-same-origin */ | ||||||||||
export let relaxed = false; | ||||||||||
/** sandbox allow-popups-to-escape-sandbox (i.e. links within the REPL to other pages work) */ | ||||||||||
export let can_escape = false; | ||||||||||
/** Any additional JS you may want to inject */ | ||||||||||
export let injectedJS = ''; | ||||||||||
/** Any additional CSS you may want to inject */ | ||||||||||
|
@@ -247,13 +249,13 @@ | |||||||||
class:inited | ||||||||||
bind:this={iframe} | ||||||||||
sandbox={[ | ||||||||||
'allow-popups-to-escape-sandbox', | ||||||||||
'allow-scripts', | ||||||||||
'allow-popups', | ||||||||||
'allow-forms', | ||||||||||
'allow-pointer-lock', | ||||||||||
'allow-top-navigation', | ||||||||||
'allow-top-navigation-by-user-activation', | ||||||||||
'allow-modals', | ||||||||||
can_escape ? 'allow-popups-to-escape-sandbox' : '', | ||||||||||
relaxed ? 'allow-same-origin' : '' | ||||||||||
Comment on lines
256
to
258
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without Without |
||||||||||
].join(' ')} | ||||||||||
class={error || pending || pending_imports ? 'greyed-out' : ''} | ||||||||||
|
@@ -269,27 +271,7 @@ | |||||||||
{#if !onLog} | ||||||||||
<PaneWithPanel pos="90%" panel="Console"> | ||||||||||
<div slot="main"> | ||||||||||
<iframe | ||||||||||
title="Result" | ||||||||||
class:inited | ||||||||||
bind:this={iframe} | ||||||||||
sandbox={[ | ||||||||||
'allow-popups-to-escape-sandbox', | ||||||||||
'allow-scripts', | ||||||||||
'allow-popups', | ||||||||||
'allow-forms', | ||||||||||
'allow-pointer-lock', | ||||||||||
'allow-top-navigation', | ||||||||||
'allow-modals', | ||||||||||
relaxed ? 'allow-same-origin' : '' | ||||||||||
].join(' ')} | ||||||||||
class={error || pending || pending_imports ? 'greyed-out' : ''} | ||||||||||
srcdoc={BROWSER ? srcdoc : ''} | ||||||||||
></iframe> | ||||||||||
|
||||||||||
{#if $bundle?.error} | ||||||||||
<ErrorOverlay error={$bundle.error} /> | ||||||||||
{/if} | ||||||||||
{@render main()} | ||||||||||
</div> | ||||||||||
|
||||||||||
<div slot="panel-header"> | ||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.