Improper SSH Host Key Validation (CWE-295) in mintupload – Man-in-the-Middle Vulnerability #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Vulnerability Overview
The
mintuploadtool (part of Linux Mint, version 4.2.2 as of January 2026) contains an insecure usage of Paramiko in the SFTP upload handler. Specifically, inmintupload_core.py(method_sftpofMintUploader), the code does:AutoAddPolicyautomatically accepts any unknown or changed SSH host key and adds it to the internal HostKeys object (and potentially to~/.ssh/known_hostsifload_host_keyswas called which it isn't here). This completely bypasses host key verification and opens the door to classic man-in-the-middle (MitM) attacks.An attacker positioned between the user and the target server (e.g., rogue Wi-Fi, ARP poisoning on LAN, DNS spoofing) can:
Since mintupload does not call
load_system_host_keys()orload_host_keys(), it also never persists the accepted key to disk, making the behavior even worse: every run treats the server as "new" and blindly accepts whatever key is presented.CVSS-like assessment (approximate):
Base Score ~7.5 (High) in MitM scenarios, Low for typical desktop use (personal trusted servers).
Proof of Concept (full reproducible steps)
Tested on fresh Linux Mint Cinnamon 22.2 with mintupload 4.2.2 (January 11, 2026).
Setup:
Create service in mintupload-manager (GUI):
Exploit steps:
Upload any file (e.g. 5MB test file):
Success notification, file appears in container
/config(verified withdocker exec -it ssh-real ls -l /config)Stop real, switch to fake key:
Repeat upload (same service):
success, no warning, no error. File now delivered to fake server.
Proof: The file was delivered to the server with a completely different host key (different fingerprint) without any user interaction or rejection. Classic MitM achieved.
Why this is dangerous
No user notification, no prompt, no rejection. Even after the first connection, if an attacker forces a key change (or known_hosts is cleared), the tool blindly trusts the new key.
Proposed fix (minimal & secure)
Replace the vulnerable lines in
_sftp:Before:
After:
Patch behavior:
SSHException/BadHostKeyExceptionupload fails with clear errorsshonce) works normallyTested patch results (same environment):
SSHException: Server '[127.0.0.1]:2222' not found in known_hostsssh -p 2222 unix@127.0.0.1(added to known_hosts): upload succeedsBadHostKeyException: Host key ... does not matchMitM blockedImpact & Recommendation
Low real-world risk for most desktop users (personal servers, low exposure). Still worth fixing because:
Recommended mitigation
Apply the patch above.
For users: add server keys manually first with
ssh -p <port> user@hostbefore using mintupload.References:
This is a real, exploitable issue. Patch is simple, standard, and preserves usability for trusted servers.
Discovered during local code review and PoC testing on Linux Mint 22.2.
:D