-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
File-copy qrexec service is overly restrictive #8332
Comments
Indeed R4.2 introduces stricter filename validation, it needs to be (among other things) proper UTF-8 string. Maybe you use some different encoding for your file names? |
I was using Debian 11 as a standalone backup, which I had shifted from Qubes 4.1 using Qubes backup. After restoring my backup, I now want to create a new standalone based on Debian 12. I successfully created the new Debian 12 standalone and attempted to transfer my files to it. However, I encountered an issue where only files with non-English characters became stuck during the transfer process. Workaround: you can change the file names to English before transferring them. Once the files have reached the destination, you can revert the changes by renaming them back to their original names. |
I recommend archiving them all into a single archive file so that you can keep the original names in the destination. B |
Note that this loses the protection provided by |
The error message (“invalid or incomplete multibyte or wide character”) is horrible, not least because it provides no information as to which character was disallowed. At a minimum, there should be separate errors for “name is not valid UTF-8” and “name contains a forbidden UTF-8 character”, and the latter must state explicitly which character was forbidden. |
Yes, and it destroys the whole concept of security improvements that I personally think, that not being able to copy symlinks and files with non-utf-8 chars in name anymore is a major design mistake. The user data should be preserved at all costs. Ext2/3/4 allows non-utf8 chars in path and that is how it is. Only '\0' is not allowed, it is the only exception according to FS specs. @marmarek @DemiMarie |
Moving my messages here: Let's consider a directory with 100 000 files. It has 1 absolute symlink somewhere in the depth, 1 relative symlink targeting above this directory, and several files that are fine except their filenames have byte sequences that cannot be interpreted as utf-8 string. User wants to copy it to the other qube (maybe much less secure) the same way as EVERY other copy tool works: like What should the user do to achieve it with the new R4.2 approach? |
There are 2 cases: from terminal and from GUI (Nautilus or Dolphin). |
I think it definitely would! For me secure is more like:
The R4.1 meets these criteria completely. My main point:
|
Best to model the Linux coreutils `cp` command?
|
@marmarta what do you think? I don’t know enough about UX to be able to make an informed statement here. @jamke So the problem with symlinks is:
|
As far as I can tell, symlinks are off-topic in this issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@DemiMarie Sounds interesting, I like the idea. |
I think this is something that could be considered. This would still preserve less metadata than |
I agree.
The whole process can be considered similar to copying between 2 air-gapped PCs with a flash-drive formatted to ext4. At least it sounds logical and fits architecture of qubes as separated PCs. |
Absolutely agree that there should be a "copy_unsafe" option; ran into this issue now several times and it is extremely annoying to deal with...even when a file name has only Latin characters it sometimes crops up, not even to mention non-Latin ones. I'll also add that UX is still pretty bad with the error message as the target qube is asked with a pop up dialogue, but the error / failure message is just an echo in the terminal; the last time I did |
That should be fixed by QubesOS/updates-status#4240 + QubesOS/updates-status#4233 Edit: Those are for GUI file copy |
Since this change is being included in Qubes OS 4.2.2, which is a patch release, I infer that the decision has been made to classify this issue as a bug rather than an enhancement. Updated labels and issue title accordingly. |
It sounds like you don't believe that it's truly unsafe. If you did, I don't believe you would be willing to make it the default or classify this change as a bug fix. In light of this, I believe that naming the new service
I discussed this with @DemiMarie, who suggested that |
|
It was renamed from allow-unsafe-characters to allow-all-names See QubesOS/qubes-core-agent-linux#508 QubesOS/qubes-issues#8332
As pointed out by Andrew David Wong the latter name is unnecessarily alarming. No backwards compatibility is provided because users should not need to remember to blocklist two different strings in their qrexec policies. Denying "+allow-all-names" should be sufficient. Reported-by: Andrew David Wong <adw@qubes-os.org> Fixes: QubesOS/qubes-issues#8332 (for real this time) (cherry picked from commit 59d94f3)
QubesOS/qubes-issues#8332 (cherry picked from commit 854320a)
Symlinks pointing outside of copied directory should be denied in both filecopy modes QubesOS/qubes-issues#8332 (cherry picked from commit 0aa1382)
It was renamed from allow-unsafe-characters to allow-all-names See QubesOS/qubes-core-agent-linux#508 QubesOS/qubes-issues#8332 (cherry picked from commit 872119f)
_posts: gpg: Good signature from "Andrew David Wong (Qubes Documentation Signing Key)" [ultimate] object 21f106602a71f1b938ffe9179b6dd8ccb5dcf016 type commit tag adw_21f10660 tagger Andrew David Wong <adw@qubes-os.org> 1719471777 -0700 Tag for commit 21f106602a71f1b938ffe9179b6dd8ccb5dcf016 21f1066 Merge branch '4.2.2-rc1' 02c932f Specify post date 5e07e83 Explain how the fix works; clarify relationship between services 4e90dcf Update QubesOS/qubes-issues#8332 service name and explanation d501c15 Release: Qubes OS 4.2.2-rc1
_doc: gpg: Good signature from "Andrew David Wong (Qubes Documentation Signing Key)" [ultimate] object 941ef460540d9f20e8e845952c194cff98803dd2 type commit tag adw_941ef460 tagger Andrew David Wong <adw@qubes-os.org> 1719471912 -0700 Tag for commit 941ef460540d9f20e8e845952c194cff98803dd2 941ef460 Merge branch '4.2.2' beac6f7e Explain how the fix works; clarify relationship between services 8da080c1 Update QubesOS/qubes-issues#8332 service name and explanation cb4ec61e Update release notes for Qubes OS 4.2.2
Qubes OS release
4.2
Brief summary
moving/coping files was working ok in 4.1 regardless their name, now its rejected due to the name of the file used.
Steps to reproduce
Try to move/copy a file in none latin letters
Expected behavior
To move/copy file regardless what characters used to name it.
Actual behavior
Tasks
More detailed design in #8332 (comment)
qfile-unpacker
to have extra options for disabling various restrictions (independently): file names validation, symlink target restriction (refusing absolute symlinks or pointing outside of target directory)qubes.UnsafeFilecopy
qrexec service with file names validation disabled (but symlinks validation enabled)The text was updated successfully, but these errors were encountered: