Skip to content
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

How to inject JS scripts on GitHub? (bypass CSP) #20

Open
micalevisk opened this issue Oct 4, 2020 · 3 comments
Open

How to inject JS scripts on GitHub? (bypass CSP) #20

micalevisk opened this issue Oct 4, 2020 · 3 comments

Comments

@micalevisk
Copy link

micalevisk commented Oct 4, 2020

when I tried to inject a dumb JS script to https://github.com I got this error:

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”).

triggered by this line:

document.head.append(el);

is there a way to bypass this?

The Content-Security-Policy response header is:

default-src 'none';
base-uri 'self';
block-all-mixed-content;
connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events wss://alive.github.com;
font-src github.githubassets.com;
form-action 'self' github.com gist.github.com;
frame-ancestors 'none';
frame-src render.githubusercontent.com;
img-src 'self' data: github.githubassets.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self';
media-src 'none';
script-src github.githubassets.com;
style-src 'unsafe-inline' github.githubassets.com;
worker-src github.com/socket-worker.js gist.github.com/socket-worker.js

btw I do not want to use Tampermonkey/Greasemonkey

@Filius-Patris
Copy link

Same happens on MS Teams (https://teams.microsoft.com)

@RobKohr
Copy link

RobKohr commented May 13, 2022

Seems to happen on twitter too

@KrischnaGabriel
Copy link

it's been three years from the opening of this issue and still no fix. 😑️
btw it also happens on spotify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants