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 links are broken for markdown files #31747

Open
Legend-Master opened this issue Mar 6, 2024 · 7 comments
Open

Image links are broken for markdown files #31747

Legend-Master opened this issue Mar 6, 2024 · 7 comments
Labels
Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-Peek Refers to Peek Powertoys

Comments

@Legend-Master
Copy link

Microsoft PowerToys version

0.79.0

Installation method

GitHub

Running as admin

Yes

Area(s) with issue?

Peek

Steps to reproduce

Use Peek to open a markdown file that contains an image

✔️ Expected Behavior

Chromium (local links)

image

Visual Studio Code (remote links)

image

❌ Actual Behavior

Chromium (local links)

image

Visual Studio Code (remote links)

image

Other Software

No response

@Legend-Master Legend-Master added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 6, 2024
@Aaron-Junker
Copy link
Collaborator

We do this for security reasons. However the user should be informed of this like in the Previewer.

image

@Aaron-Junker Aaron-Junker added the Product-Peek Refers to Peek Powertoys label Mar 6, 2024
@htcfreek
Copy link
Collaborator

htcfreek commented Mar 6, 2024

We should add an information about the disabled JavaScript when previewing HTML files too. Because the html file might behave broken without JavaScript.

@Legend-Master
Copy link
Author

Is it possible to just allow local images and videos? This alone shouldn't cause any security problems I think

@Aaron-Junker
Copy link
Collaborator

Is it possible to just allow local images and videos? This alone shouldn't cause any security problems I think

I would like to disagree. The security concern for other local images is not really there, but imagine the following scenario:

  1. Someone wants to find out your IP Address, but they only have your email
  2. With this enabled they can just send a Markdown file with an image per Mail.
  3. You don't even have to open it, just clicking on the file on Explorer will invoke loading the image
  4. For loading the image a web request will be sent to the attackers server and surprise they have your IP address.

That's why I don't think enabling this would be a good idea.

@Legend-Master
Copy link
Author

Legend-Master commented Mar 7, 2024

A remote resource would be a problem, so I asked if allowing just the local images would be possible, as a lot of readme files contain path reference images

If we we can't separate local resources from the remote ones, I agree disable this entirely would be the right choice

@Welding-Torch
Copy link

Would be great if a way to fix this was found.

Maybe you can try sending the request to get the image/video data through the default browser (like Chrome)? That way the security of it is handled by Chrome and the previewer gets to show the media.

@somethingSTRANGE
Copy link

If the images linked using markdown are local and not remote images, what's the security concern? Local GIF, PNG, JPG, AVIF, and WEBP cannot make remote calls when opened, as far as I know. Maybe with local SVG links, this might be considered a security issue.

Please address this issue. The entire point of the peek/preview is that we'd like to avoid opening the files in other applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-Peek Refers to Peek Powertoys
Projects
None yet
Development

No branches or pull requests

5 participants