Skip to content

Commit

Permalink
Add CSP to content pages (#44)
Browse files Browse the repository at this point in the history
Let's add a csp so the extension cannot connect to remote things. 
Also makes sure to only load .js that is inside the extension, so
xss'ing an input field is quite a bit harder :)
  • Loading branch information
strseb authored Aug 30, 2024
1 parent b16c722 commit e332f15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/browserAction/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
<!doctype html>
<html>
<head>
<meta
http-equiv="content-security-policy"
content="script-src 'self';img-src 'self'; font-src 'self'; connect-src 'none'; media-src 'none'; object-src 'none'; prefetch-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none';"
/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="popup.css" />
<link rel="stylesheet" href="../variables.css" />

<script src="./popupPage.js" type="module"></script>
<title>Mozilla VPN</title>
</head>
Expand Down
4 changes: 4 additions & 0 deletions src/ui/pageAction/pageActionPopup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<!doctype html>
<html>
<head>
<meta
http-equiv="content-security-policy"
content="script-src 'self';img-src 'self'; font-src 'self'; connect-src 'none'; media-src 'none'; object-src 'none'; prefetch-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none';"
/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../variables.css" />
<link rel="stylesheet" href="./pageAction.css" />
Expand Down
4 changes: 4 additions & 0 deletions src/ui/settingsPage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<!doctype html>
<html>
<head>
<meta
http-equiv="content-security-policy"
content="script-src 'self';img-src 'self'; font-src 'self'; connect-src 'none'; media-src 'none'; object-src 'none'; prefetch-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none';"
/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../variables.css" />
<title>Mozilla VPN Settings</title>
Expand Down

0 comments on commit e332f15

Please sign in to comment.