#980345 run-mailcap: shell command injection vulnerability

Package:
mailcap
Source:
mailcap
Submitter:
Marriott NZ
Date:
2021-01-17 22:48:04 UTC
Severity:
normal
Tags:
#980345#5
Date:
2021-01-17 22:45:34 UTC
From:
To:
Dear Maintainer,

run-mailcap is vulnerable to shell command injection in its input data.
Specifically, commands can be injected into a MIME type name, a charset name, or
 other data originating from a Content-Type header.
If run-mailcap is used by some mail program or script for mailcap support, then a malicious message can cause the execution of arbitrary shell code just by being displayed.

(Test with --norun, at your own risk.)
-- rule
text/*; /usr/bin/w3m -T %t %s
-- exploit
$ type='text/$(rm -fr *)' # e.g. from a malicious mail header
$ run-mailcap --action=view "$type":filename