-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 X41 D-Sec GmbH Security Advisory: X41-2018-007 Multiple Vulnerabilities in mgetty ================================== Overview - -------- Confirmed Affected Versions: 1.2.0 Patched Versions: 1.2.1 Vendor: mgetty Vendor URL: http://mgetty.greenie.net Credit: X41 D-Sec GmbH, Eric Sesterhenn Status: Public Advisory-URL: https://www.x41-dsec.de/lab/advisories/x41-2018-007-mgetty Summary and Impact - ------------------ Multiple issues have been identified in the mgetty fax software. These might be used by local users to elevate their privileges. X41 did not perform a full test or audit on the software. Product Description - ------------------- - From the vendor: For those of you that do not know mgetty+sendfax yet: it's a reliable and proven fax send and receive solution for unix and Linux. But it can do much more... so read the docs and be surprised. Shell injection via faxq-helper =============================== Severity Rating: Medium Vector: Fax Job CVE: CVE-2018-16741 CWE: 78 CVSS Score: 6.1 CVSS Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N In fax/faxq-helper.c function do_activate(), not all characters are properly sanitized to prevent command injection. It is possible to use ||, && or > to change the control flow. {% highlight c %} /* replace all quote characters, backslash and ';' by '' */ for( q = buf; *q != '\0'; q++ ) { if ( *q == '\'' || *q == '"' || *q == '`' || *q == '\' || *q == ';' ) { *q = ''; } } {% endhighlight %} A job file containing malicious input can be constructed using faxq-helper activate . One faxrunq is started, the code is executed as the user running the command. {% highlight bash %} /* replace all quote characters, backslash and ';' by '' */ # " ' \ $ ; command=tr -d '\042\047\140\134\044\073' (pwd ? 0 : 1)) badlogin(tbuf); failures = 0; } (void)strcpy(tbuf, username); {% endhighlight %} Stack Based Buffer Overflow With Long Argument in contrib/scrts.c ================================================================= Severity Rating: Low Vector: Command Line Parameter CVE: CVE-2018-16742 CWE: 121 CVSS Score: 2.9 CVSS Vector: CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N In file contrib/scrts.c a stack buffer overflow can be triggered via command line parameter. {% highlight c %} int main( int argc, char ** argv ) { int i, fd; struct termios tio; char device[1000]; for ( i=1; i/dev/null 2>&1", MAILER, mailto ); pipefp = popen( buf, "w" ); {% endhighlight %} Endless loop in g3/g32pbm.c =========================== When converting g32 files using g3/g32pbm.c, an endless loop can be triggered by malformed input file. Example can be found at files/g32pmbinfiniteloop. Out Of Bounds Access in g3/pbm2g3.c =================================== When converting pbm files using g3/pbm2g3.c, out of bounds accesses can occur with malformed input files in putwhitespan(). An example can be found with files/pbm2g2oobaccess. {% highlight c %} putcode( twhite[l].bitcode, twhite[l].bitlength ); {% endhighlight %} Workaround - ---------- None. Timeline - -------- 2018-06-07 Issues found 2018-08-27 Issue reported to vendor 2018-08-28 Vendor reply 2018-09-08 Vendors sends patches 2018-09-08 CVE IDs requested 2018-09-09 CVE IDs assigned 2018-09-11 Patched Version released 2018-09-11 Advisory released About X41 D-SEC GmbH ==================== X41 is an expert provider for application security services. Having extensive industry experience and expertise in the area of information security, a strong core security team of world class security experts enables X41 to perform premium security services. Fields of expertise in the area of application security are security centered code reviews, binary reverse engineering and vulnerability discovery. Custom research and a IT security consulting and support services are core competencies of X41. - -- X41 D-SEC GmbH, Dennewartstr. 25-27, D-52068 Aachen T: +49 241 9809418-0, Fax: -9 Unternehmenssitz: Aachen, Amtsgericht Aachen: HRB19989 GeschA$?ftsfA1/4hrer: Markus Vervier -----BEGIN PGP SIGNATURE----- iQJLBAEBCAA1FiEEpwxVTgxAIcUvTugIo5Klpg50CxAFAlui40AXHGFkdmlzb3Jp ZXNAeDQxLWRzZWMuZGUACgkQo5Klpg50CxDAKg/6AmXcOmQnCDVgORX9xbmLvCXc EcfNX7MNKlvegdm4D0TWb9WZKbWC0ubv1vSMB35qtYKMtdIwh/lYReb01/+WmRwV alZTSnoPZmy3Wt0e1mzkSEjJqauawbVAZfi9bfgUmX1faWDkntkoOhfJVcGy2Tia g0eiang5lg1v4m5yjiE4EHyzBKy+DqEYf6VNCje7cIQG/tFhuvatmd1HulZpFgK5 D/VBRCctKXaLNuoe5cIRmRD2tJZ4O7NmhudBVxJSrShTtv4cO0M6xPD0ddzhSHtn JnuNdqYY0+sdVO+uf9kOF8qHG6iW1fLKiQAuyYZCTCZELDOUzby1x0IN2XwNxiX4 b2sl1vp/XoPvlIloZehTOtaYZimUjoSo65nMZb5Dlnc5zjkWHitD8CSSnuTJbuUQ NL9b4IYJjGqjuTl9UAbdi4dXLUEgiXe4gTr399LqFKyRwYj1CJ5LKR+C6F1YW6FG y8BoT4JGUd269HcQMUhO286XuEB3yGdEiEpY4M2iakyi880GNUf5bWi3dxC3LDIG l7yHqLFZku3Aa7PZMCsfIr9NVG0gkEido8lm3LPnxnl5NbBEyZZh8IAwSKRrdKIZ MXzuedk1J6i0K2pwy6xMDkLz+VeMmOzn2HuCVh4cD5Z/Bq0wmrpBB76hdKOdxfVV c+Rqt+7zn4K6wFi28S0= =g4wJ -----END PGP SIGNATURE-----