Whatsapp Lets You Execute Python Php Scripts With No Warning
WhatsApp for Windows allowed certain executable file types, such as Python ZIP apps, to be opened directly without the usual warning that appears for other dangerous files. An attacker could send such a file and, if the victim opened it, run code on the victim's machine.
Recently, a security researcher named Saumyajeet Das discovered a vulnerability while experimenting with various file types that could be sent in WhatsApp conversations. He was testing to see if WhatsApp would allow any malicious scripts or files to be sent through the platform.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely WhatsApp's Windows client did not apply its usual warning or blocklist to certain executable file extensions such as .pyz, .pyzw and .evtx.
Impact
An attacker could run arbitrary commands on a victim's Windows machine if the victim opened the sent file, and could also spread malicious files to contacts and groups.
What the attacker needed
WhatsApp for Windows; victim opens the received file; attacker can send a file to the victim
The fix
The issue should be fixed by adding these executable file extensions to WhatsApp's blocklist or warning system.
How it was found
- Create a Python file that connects back to the attacker and save it with a .pyz extension.
- Send the file to the victim through WhatsApp.
- Start a listener on the chosen port on the attacker's machine.
- Have the victim open the received file on their Windows machine.
- Use the resulting connection to run commands on the victim's machine.
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 write-up has not been written yet. The Original tab links to the source.
Some file types can run code when opened, like a program. WhatsApp normally warns you before opening these, but the researcher found that a few file types skipped that warning. If a victim opened one, the sender could control their computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.