-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Error when TLS connection not properly closed #529
Comments
Just to be sure, which version of Himalaya CLI do you use? IMAP logs look like from the previous library. Make sure you are using the |
Full config:
Installed it via Cargo but error persists:
Version:
Config (when installed via Cargo):
|
Please upgrade to the |
The error persists when installed with Version:
|
Both IMAP lib used (before and now) were based on Rustls, it looks like the issue is beyond Himalaya scope. I do not understand how and why it appears, especially that I do not reproduce it with my own Gmail account. According to Rustls:
So it is not really an error (do you confirm that the message is moved properly?), it is more like a security warning about the connection not properly closed. Not sure if as a lib consumer it is safe to ignore the error. @duesee any opinion? |
Absolutely! In all settings - Cargo, nixpkgs, repo flake. Please give me a day to test it with another Gmail account. |
Since it is more like a warning, it maybe makes sense to treat it as such, by emitting a log instead? |
Log should be appropriate given no other reports. Same behavior with a second account. |
As far as I understand, some implementations don't do a clean TLS shutdown which results in this error/warning. The attack which one can be worried about is a truncation attack. For example, if a Bash script is piped into a shell and an attacker can truncate the script, it may leave a machine in an incosistent state. For IMAP, I cannot come up with a good attack, though. If an attacker can truncate a message, it will propably always result in a parsing error. Maybe there is a case I miss, but I don't see how to truncate a message in a way that would change it's meaning (ignoring parse errors). Examples:
Maybe a warning is enough? |
What is the worst that can happen if an attacker can truncate at any point? I feel it should be not too much because it would also be a reliability problem. Non-atomic move comes to mind:
If truncation happens after copy and before delete, we'll end up habing a duplicate message. But... yeah :-) |
Awesome, thank you for your replies. Let's go for a simple warning for the next release! |
I started to work on this issue, and there is an edge case I'm not sure how to properly handle. Let's say you move a message. The client sends the request to the server, and the server processes the move but returns a missing How to handle this case? My naive intuition tells me to show a warning only when an IMAP task does not produce any output. Otherwise return a better error like "the action may not have been executed due to an unexpected closed stream". |
To give more context about the @vglfr moving message issue, the |
After setting
folder.alias.trash = "[Gmail]/Trash"
message is deleted successfully but an error is thrown.Command:
himalaya message delete 27301 --trace
Log exert:
Executing
a35 uid move 27302 "[Gmail]/Trash"
inopenssl s_client
throws406788D0607F0000:error:0A000126:SSL routines::unexpected eof while reading:ssl/record/rec_layer_s3.c:687:
and quits repl but the message got deleted.Executing
a32 store 11044 +flags \deleted
deletes message successfully.The text was updated successfully, but these errors were encountered: