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

Disable inter-VM pasting into templates by default #6602

Closed
herypt opened this issue May 13, 2021 · 12 comments
Closed

Disable inter-VM pasting into templates by default #6602

herypt opened this issue May 13, 2021 · 12 comments
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. R: declined Resolution: While a legitimate bug or proposal, it has been decided that no action will be taken. security This issue pertains to the security of Qubes OS. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. ux User experience

Comments

@herypt
Copy link

herypt commented May 13, 2021

The problem you're addressing (if any)
Currently it's way too easy to accidentally paste something in a terminal window in a template and compromise it.

Describe the solution you'd like
Disabling pasting to templates, this can be done by adding $anyvm $type:TemplateVM deny to /etc/qubes-rpc/policy/qubes.ClipboardPaste.

Where is the value to a user, and who might that user be?
This prevents users from accidentally compromising their templates. While this also breaks pasting things on purpose to a template, that isn't secure in most cases anyway.

Additional context
You can't paste to dom0 either.

Related, non-duplicate issues
#6347
https://groups.google.com/g/qubes-devel/c/JJN9GZMmp5s/m/AW7gzjK1tEgJ

@herypt herypt added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. labels May 13, 2021
@andrewdavidwong
Copy link
Member

andrewdavidwong commented May 13, 2021

Describe the solution you'd like
Disabling pasting to templates, this can be done by adding $anyvm $type:TemplateVM deny to /etc/qubes-rpc/policy/qubes.ClipboardPaste.

The solution you'd like is already implemented, so there is nothing to be done. I'm guessing you meant to say that you think this should be the default?

I can see the rationale for that, since it would make templates more secure by default. However, as usual, it's a trade-off between security and convenience, and most users won't know how to enable copy/pasting into templates if they do need it. (Yes, they could learn how by reading the documentation, but in practice, the vast majority will never make it that far.)

As you point out, we do already restrict copy/pasting into dom0. I think the rationale is that if dom0 is compromised, it's game over, whereas if a template is compromised, it's not (some people have untrusted templates), and users can choose to add further restrictions on templates, if they wish. Ultimately, it's a judgment call where to draw the line. One relevant consideration is how often users need to copy/paste into templates and which workflows might require this.

Although I'm a big fan of the principle of secure defaults, it does not follow that literally every possible security measure should be enabled by default, since that would guarantee the system is unusable by all but a few experts. Judgement is still required, and I leave that judgment to the developers and UX experts.

@andrewdavidwong andrewdavidwong changed the title Disable inter-VM pasting for templates Disable inter-VM pasting into templates by default May 13, 2021
@andrewdavidwong andrewdavidwong added C: Arch Linux The Arch Linux template C: core security This issue pertains to the security of Qubes OS. ux User experience labels May 13, 2021
@andrewdavidwong andrewdavidwong added this to the TBD milestone May 13, 2021
@andrewdavidwong andrewdavidwong removed the C: Arch Linux The Arch Linux template label May 13, 2021
@DemiMarie
Copy link

I personally support this. I do not remember having ever had to paste into a template.

@GWeck
Copy link

GWeck commented May 13, 2021

What about setting the policy to ask and let the user decide? This could be done by adding $anyvm $type:TemplateVM ask to /etc/qubes-rpc/policy/qubes.ClipboardPaste, as far as I understand it. This would be somewhat inconvenient but still better than denying it completely, and it should be used only rarely so that this inconvenience could be tolerated.

@andrewdavidwong
Copy link
Member

What about setting the policy to ask and let the user decide? This could be done by adding $anyvm $type:TemplateVM ask to /etc/qubes-rpc/policy/qubes.ClipboardPaste, as far as I understand it. This would be somewhat inconvenient but still better than denying it completely, and it should be used only rarely so that this inconvenience could be tolerated.

That's no different from how it is now. When it comes to inter-VM copy/paste, ask just requires using the inter-VM copy/paste shortcuts (ctrl+shift+C and ctrl+shift+V by default).

@ninavizz
Copy link
Member

ninavizz commented May 13, 2021

@eloquence Thoughts on how this ticket (that is partially flying over my head for what it is asking vs what already exists and my cognitive ability to multitask and get my head around this in the process) may or may not impact our Workstation users?

@unman
Copy link
Member

unman commented May 14, 2021 via email

@herypt
Copy link
Author

herypt commented May 14, 2021

@unman There is no dialog for pasting, ask just means that the user needs to do Ctrl+Shift+V.
While disabling this will certainly make some actions more difficult, pasting commands from the web in templates is insecure as websites/the qube used for browsing the web can inject any command it wants into the clipboard.

@ddevz
Copy link

ddevz commented May 14, 2021

So there was the assumption of a "OK" button.

I'll state what in my mind would seem ideal. It would be extending the options for the qubes.ClipboardPaste file with a "ask-gui" option which would pop a gui dialog, and ask.

One option would be make it configurable to ask something like "this is a template, are you sure?".

However another option could be for the dialog to say something like:

You are about to paste "apt-get install dwarf-fortress; rm -rf " into the template debian-10. are you sure you want to do this?

In my mind that would be ideal. However, its easy to talk. Implementing it might be another story.

@unman
Copy link
Member

unman commented May 15, 2021 via email

@eloquence
Copy link

eloquence commented May 15, 2021

Changing the default to make an already inscrutable operation (inter-VM copy/paste) more difficult for one specific, narrowly defined case sounds like a recipe for usability debt that will be difficult to pay off in future. This is IMO something that should be configured by individual users, until the copy/paste system as a whole is overhauled to give users more straightforward access to managing copy/paste permissions and understanding copy/paste failures.

@ninavizz
Copy link
Member

A point of note that I feel may help resolve the concerns this issue seems to have been created around: next-up on my list of Qubes UX Needs is designing a Policy Manager GUI for folks. Based on what I'm looking at in this Issue, a need for that project will be surfacing these opportunities and decisions by the user, or by Qubes as a default.

I do not disagree with the initial flag by @herypt but I am with @eloquence and @unman in wanting to offer users agency to make these decisions for themselves—in an easy to discover and intuitive fashion—else, we create more problems.

That said—because I'm about to begin that project, AND I have personally experienced the problem @herypt filed this issue about, I appreciate you summarizing this user problem and creating the issue to generate discussion around it, Herypt! I need as much as I can to inform this Policy Manager project.... as it's making visually concrete and actionable, a "problem" that has not yet been solved by any GUI as of yet. (so, it's hard!) :)

@andrewdavidwong
Copy link
Member

Sounds like this is a "won't do." If anyone has a new reason for why this should be done, please leave a comment, and we'll be happy to take another look. Thank you.

@andrewdavidwong andrewdavidwong added the R: declined Resolution: While a legitimate bug or proposal, it has been decided that no action will be taken. label May 17, 2021
@andrewdavidwong andrewdavidwong removed this from the Release TBD milestone Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. R: declined Resolution: While a legitimate bug or proposal, it has been decided that no action will be taken. security This issue pertains to the security of Qubes OS. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. ux User experience
Projects
None yet
Development

No branches or pull requests

8 participants