-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Escape Sequences in Filenames are not Filtered #595
Comments
Thanks, this would be a great PR to have |
Mitre assigned CVE-2023-43620 to track this issue. |
Shouldn't CVE-2023-43620 cover 9.6.6 as well? |
This problem is still incompletely addressed due to the fact that the offending filename is still written to stdout, even if transmission is then stopped:
This is an example how CSI escape sequences can still trigger on the receiver side:
On the receiving side the error text from the line above will appear, and the CSI escape sequence will be executed, causing the terminal to switch to the "alt screen". Fixing this should be simple: Don't output the problematic path. |
Filenames on Linux can contain arbitrary characters except for the path separator '/'. Thus filenames can also contain possibly dangerous characters like ASCII control codes (newline, linefeed, etc.) or even complete ANSI/CSI terminal escape sequences.
On the Croc receiver side the filenames communicated by the sender side are accepted unfiltered and are also output on stdout during transmission. When the latter happens, the escape sequences are interpreted by the receiver's terminal and can lead to colored text, moving the cursor around or - if an insecure terminal emulator setup is used - even arbitrary code execution can be achieved.
In particular this issue is a nice addition to issues #593 and #594, since it allows to hide filenames of previously transmitted files on stdout, therefore making the attack less conspicuous. This is an example of how this can be done:
An interactive user will only see the "harmless" file, probably not noticing that a file seems to be "missing" in the output.
To fix this Croc should filter filenames on the receiver side and either reject or replace any unsafe non-printable characters.
The text was updated successfully, but these errors were encountered: