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

Missing src attribute on img elements in posts when using data URIs #1266

Closed
humphd opened this issue Nov 1, 2020 · 3 comments · Fixed by #1282
Closed

Missing src attribute on img elements in posts when using data URIs #1266

humphd opened this issue Nov 1, 2020 · 3 comments · Fixed by #1282
Assignees
Labels
type: bug Something isn't working

Comments

@humphd
Copy link
Contributor

humphd commented Nov 1, 2020

I notice a post today that is missing images. The <img> element is there, but it has no src attribute:

Screen Shot 2020-11-01 at 6 15 15 PM

The original post does have them: https://palak-chawla.blogspot.com/2020/10/release-02-pr-4.html, but they are using Data URIs:

Screen Shot 2020-11-01 at 6 17 40 PM

@humphd humphd added the type: bug Something isn't working label Nov 1, 2020
@chrispinkney
Copy link
Contributor

Interesting, I'll have to read up about data URIs, can't say I've heard of them until now.

Could I give this a shot?

@humphd
Copy link
Contributor Author

humphd commented Nov 2, 2020

A data URI is a way of embedding a resource in the URL itself. You only use it for small items, for example, a favicon or an image. The nice thing about them is that they don't require any server storage. However, our sanitizer is filtering them out, since they don't use a secure origin.

@humphd
Copy link
Contributor Author

humphd commented Nov 2, 2020

Assigned to you, @chrispinkney

humphd pushed a commit that referenced this issue Nov 6, 2020
…s with data uris (#1282)

* fixes issue-1266, adds a test to ensure data URIs are sanitized properly
  * added two more http and https schema tests for img tag with a data uri src
  * added blockquote test and cite sanitation

* removed irrelevant test, removed allowed attribute, and added a protocolless test.

* added helpful comment regarding mixed content to img tag over http test
manekenpix pushed a commit to manekenpix/telescope that referenced this issue Nov 11, 2020
…rse img tags with data uris (Seneca-CDOT#1282)

* fixes issue-1266, adds a test to ensure data URIs are sanitized properly
  * added two more http and https schema tests for img tag with a data uri src
  * added blockquote test and cite sanitation

* removed irrelevant test, removed allowed attribute, and added a protocolless test.

* added helpful comment regarding mixed content to img tag over http test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
2 participants