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

Image doesn't display when linked with the Markdown format #275

Closed
ohmer1 opened this issue Jan 26, 2018 · 8 comments
Closed

Image doesn't display when linked with the Markdown format #275

ohmer1 opened this issue Jan 26, 2018 · 8 comments

Comments

@ohmer1
Copy link

ohmer1 commented Jan 26, 2018

It works if the link is from the same domain as the privatebin host, but doesn't work if the link is from an external domain,

Additional information

![Logo](https://assets-cdn.github.com/images/modules/open_graph/github-mark.png)

![Logo2](https://privatebin.net/img/icon.svg)

The second logo display fine (same domain), but the first show a "broken image" on the browser (external domain).

Dev tools logs that:
Refused to load the image 'https://assets-cdn.github.com/images/modules/open_graph/github-mark.png' because it violates the following Content Security Policy directive: "img-src 'self'

Basic information

Server address: https://privatebin.net (but I also have the same problem on my own instance)

I can reproduce this issue on https://privatebin.net: Yes

@ohmer1
Copy link
Author

ohmer1 commented Jan 26, 2018

I RTFM and found that I can already configure the content policy in the configuration file. I whitelisted my root domain name for the img-src. I wonder if this would be an issue to whitelist any source for image, but I don't need it for now. Sorry for the noise!

@ohmer1 ohmer1 closed this as completed Jan 26, 2018
@rugk
Copy link
Member

rugk commented Jan 26, 2018

Yes, you did identify the issue correctly. So you don't have to apologize for the noise, it is indeed a valid issue, considering that it is a feature of markdown we break here.🙃
So I open this issue, I think it is a valid idea to just allow images from anywhere, they do not pose any risk here. And, of course, admins can adjust it.

@rugk rugk reopened this Jan 26, 2018
@elrido
Copy link
Contributor

elrido commented Apr 29, 2018

I think this does pose a certain risk to allow injection of remote code (for example by using exploits in the image processing libraries in the browser), it does also allow tracking of server access by third parties. I do see the use case for this with mark-down.

I would suggest to leave it off by default, but to add a FAQ entry (and/or comment in the config file in the cspheader section) explaining how to enable it and for example limit it to images via https (that would probably be img-src 'self' data: https:?) or even to certain domains.

@elrido elrido closed this as completed Jun 30, 2018
@rugk
Copy link
Member

rugk commented Jun 30, 2018

(for example by using exploits in the image processing libraries in the browser)

Well… very far fetched, but…

it does also allow tracking of server access by third parties

That's a point!

So do we have that FAQ/comment already you mentioned earlier?

@elrido
Copy link
Contributor

elrido commented Jun 30, 2018

Feel free to add one, THX.

rugk added a commit that referenced this issue Jul 1, 2018
@rugk
Copy link
Member

rugk commented Jul 1, 2018

@ZerooCool
Copy link
Contributor

ZerooCool commented Jun 25, 2020

+1 for CSP :
Content Security Policy: Les paramètres de la page ont empêché le chargement d’une ressource à https://privatebin.net/img/icon.svg (« img-src »).

Then, modifiy the CSP, and / or, use only image from your server.

@rugk
Copy link
Member

rugk commented Jun 29, 2020

@ZerooCool Yes this is already stated in our FAQ entry linked directly before your comment: https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-not-it-load-embedded-images

There is no need to comment here and revive such old issues that are documented and "solved".

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