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

Files with the wrong extension are opened in the wrong application #2171

Open
legoktm opened this issue Aug 21, 2024 · 1 comment
Open

Files with the wrong extension are opened in the wrong application #2171

legoktm opened this issue Aug 21, 2024 · 1 comment

Comments

@legoktm
Copy link
Member

legoktm commented Aug 21, 2024

Description

Files with incorrect extensions are opened according to the extension, not the actual file type

Steps to Reproduce

Please specify your environment if that is necessary to reproduce the bug (if in
doubt, include it).

  1. Grab a webp image from somewhere, and rename the file extension to be .txt.

Expected Behavior

  1. It opens in an image viewing application

Actual Behavior

  1. Binary gibberish is shown in a text editor

Comments

MIME type sniffing can be a minefield but this is less about the security implications (everything is inside a dispVM) but rather giving journalists a good UX when a mislabeled file is sent.

@rocodes
Copy link
Contributor

rocodes commented Aug 22, 2024

Thanks for filing - I think this should happen, but I took a quick look and realized we should treat it as either ancillary to freedomofpress/securedrop-workstation#1139 and our other issues around standardizing the export/view pipeline, or possibly as an upstream question.

Right now we rely on qvm-open-in-vm (qopen-in-vm) and the mime handling in the dispvm, which relies on xdg-open to pick the right program. It looks like whatever xdg-mime query thinks is the right application is what will be selected (xdg-mime), and I don't know if there's an option to use magic bytes and ignore the extension the way there is with file or mime. Just wanted to dump some info here, will think about this more later.

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

2 participants