putty pscp client-side post-auth stack buffer overwrite when processing remote file size
A stack buffer overflow in PuTTY's pscp client when processing a remote file size allows an attacker to overwrite the stack and potentially execute code. The report also describes two denial-of-service conditions in SSH packet handling that cause null pointer dereferences.
- Fixed in 22 days
- Disclosed after 3.7 years
Summary by the program
https://github.com/tintinweb/pub/tree/master/pocs/cve-2016-2563
The report
Not sure if this will qualify but it may impact a pretty broad audience given the fact that putty code is part of many other apps (filezilla, ...) and it is the defacto standalone ssh client for windows administrators (besides openssh cygwin)
putty <= 0.66; affects putty versions dating back ~9 years.
Vulnerability Note: https://github.com/tintinweb/pub/tree/master/pocs/cve-2016-2563 Vendor Security Notification: http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-pscp-sink-sscanf.html
provided patch and PoC to vendor. was resolved within one week (which is very impressive!).
patch/poc will be released later today on this github account.
in total reported:
- mem-corruption/remote code execution via stack buffer overwrite in putty pscp (connect vulnerable putty to poc.py to trigger an EIP=0x41414141 (AAAA) bad instruction.
- DoS condition in the parsing of SSH-Strings (core packet handling) that lead to a nullptr read. (connect putty to poc.py and type x11exploit to trigger one occurrence of a crash)
- DoS condition in the handling of unrequested forwarded-tcpip channels open requests that lead to a nullptr read. (connect putty to poc.py and type forwardedtcpipcrash to trigger crash)
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a missing bounds check when parsing the remote file size into a fixed-size stack buffer.
Impact
An attacker could cause memory corruption and potentially remote code execution, and could also trigger denial-of-service crashes.
What the attacker needed
Victim connects to malicious SSH server; attacker controls SSH server
The fix
The vendor provided a patch and resolved the issue within one week.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
PuTTY is a popular SSH client for Windows. When it downloads a file, a flaw in handling the file size sent by the server can overwrite the stack. An attacker controlling the server may be able to run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.