question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Content Security Policy to Dweets

See original GitHub issue

Currently, it’s possible to write a dweet that pulls in resources from outside sources (scripts, images, videos, etc).

A content security policy (CSP) can be used to block external resources from being loaded on dweet pages (//dweet.dwitter.net/id/####/ - the inner page of the iframe).

This would block dweets from pulling in external resources, which can be used as a means of bypassing the 140 byte limit or to execute cross-site request forgeries.

Making this change does come with one caveat, which is that it would break any existing dweets that make use of external resources. Not to pick on cantelope specifically, but here are some of his dweets as examples:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nderscorecommented, Oct 23, 2017

@atesgoral For example, a dweet containing the following snippet could be used to force users to log out of the site:

document.write("<img src='//www.dwitter.net/accounts/logout/'>")
1reaction
lionleafcommented, Aug 6, 2018

This is completed now, but see #367 for some remaining issues. Closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content-Security-Policy Header CSP Reference & Examples
The new Content-Security-Policy HTTP response header helps you reduce XSS risks on modern browsers by declaring which dynamic resources are allowed to load....
Read more >
Content Security Policy (CSP) - HTTP - MDN Web Docs
Chrome Edge Content‑Security‑Policy Full support. Chrome25. more. Toggle history Full sup... base‑uri Full support. Chrome40. Toggle history Full sup... block‑all‑mixed‑content. Deprecated Full support. ChromeYes. Toggle history...
Read more >
x-content-security-policy header - WordPress.org
To enable CSP, you need to configure your web server to return the Content-Security-Policy HTTP header. (Sometimes you may see mentions of the...
Read more >
Figure out how to load site with Content-Security-Policy ...
Currently we strip "content-security-policy" when loading documents. allow rewriting this header in a plugin to only strip what is preventing ...
Read more >
Content Security Policy: A successful mess between ...
In this talk, we distill our multi-year experience fighting XSS at Google with nonce-based Content Security Policy (CSP), one of the most ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found