Bug 1628754 (CVE-2018-16741) - CVE-2018-16741 mgetty: command injection in faxrunq
Summary: CVE-2018-16741 mgetty: command injection in faxrunq
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2018-16741
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1628755 1630791
Blocks: 1628756
TreeView+ depends on / blocked
 
Reported: 2018-09-13 21:44 UTC by Laura Pardo
Modified: 2023-03-24 14:14 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A command injection flaw was discovered in mgetty in the faxrunq script used to send queued faxes. The shell script faxrunq does not properly escape the arguments passed to faxsend before evaluating the command allowing a user, who has permissions to queue faxes in the system, to execute arbitrary command with elevated privileges.
Clone Of:
Environment:
Last Closed: 2021-10-25 22:16:23 UTC
Embargoed:


Attachments (Terms of Use)
upstream patch (1.28 KB, patch)
2018-09-19 09:26 UTC, Riccardo Schirone
no flags Details | Diff

Description Laura Pardo 2018-09-13 21:44:43 UTC
An issue was discovered in mgetty before 1.2.1. The shell script faxrunq does not properly escape arguments passed to faxsend and that may lead to command injection. A local user may use faxq-helper to sneak in some shell metacharacters (e.g. ||, &&, >) in the fax job file, that will be later parsed by faxrunq.


References:
https://lists.debian.org/debian-lts-announce/2018/09/msg00012.html
https://www.x41-dsec.de/lab/advisories/x41-2018-007-mgetty/

Comment 1 Laura Pardo 2018-09-13 21:45:04 UTC
Created mgetty tracking bugs for this issue:

Affects: fedora-all [bug 1628755]

Comment 3 Riccardo Schirone 2018-09-19 09:26:14 UTC
Created attachment 1484634 [details]
upstream patch

This patch was extracted from mgetty-1.2.1

Comment 4 Riccardo Schirone 2018-09-19 09:30:40 UTC
faxrunq SHELL script does not properly escape the parameters before evaluating
the command to send the fax, thus the characters that sneak in thanks to loose
checks in faxq-helper.c:do_activate() can be used to inject commands.

Comment 6 Riccardo Schirone 2018-09-19 09:35:01 UTC
Mitigation:

Allow only trusted users to run the faxq-helper binary, by correctly setting the /etc/mgetty+sendfax/fax.allow configuration file.

Comment 7 Riccardo Schirone 2018-09-19 09:36:31 UTC
By default /etc/mgetty+sendfax/fax.allow does not exist on RHEL and only root is allowed to run faxq-helper binary, thus only root can exploit this flaw.

Comment 8 Fedora Update System 2019-02-27 01:15:26 UTC
mgetty-1.1.37-10.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2019-02-27 03:28:16 UTC
mgetty-1.1.37-11.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.