-
Notifications
You must be signed in to change notification settings - Fork 28
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
Replace line-feed with comma plus space in message #41
Conversation
qubesusbproxy/core3ext.py
Outdated
@@ -642,9 +642,10 @@ async def on_device_attach_usb(self, vm, event, device, options): | |||
else: | |||
# TODO: sanitize and include stdout | |||
sanitized_stderr = ''.join( | |||
[chr(c) for c in e.stderr if 0x20 <= c < 0x80]) | |||
[chr(c) for c in e.stderr if 0x20 <= c < 0x80 | |||
or c in [0x0A, 0x0D]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think simply allowing newlines in an exception message is a good idea. Depending on what applications will do with that, it may mess with formatting, or even allow injecting something. This is especially important since it's about a message received from a VM - that's why it's sanitized after all.
Maybe better to replace disallowed chars with something (we use "_" for that in several places) instead of just removing them? Or replace newline specifically with a coma?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or replace newline specifically with a coma?
Very well said. But coma+space (or semicolon+space.). Amendment will follow shortly.
866047e
to
9264727
Compare
@marmarek This is fixed as advised. The last force-push was to change the commit message |
9264727
to
7daba26
Compare
resolves: QubesOS/qubes-issues#5701