Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1037393 - xdialog FTBFS if "-Werror=format-security" flag is used
Summary: xdialog FTBFS if "-Werror=format-security" flag is used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xdialog
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Conrad Meyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1038083
TreeView+ depends on / blocked
 
Reported: 2013-12-03 06:06 UTC by Dhiru Kholia
Modified: 2014-03-25 03:45 UTC (History)
4 users (show)

Fixed In Version: xdialog-2.3.1-13.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-12 02:53:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dhiru Kholia 2013-12-03 06:06:39 UTC
Description of problem
----------------------

xdialog fails to build if "-Werror=format-security" flag is used.

...

main.c:271:2: error: format not a string literal and no format arguments [-Werror=format-security]

...

We are working on a proposal to enable "-Werror=format-security" for all
packages. Once this flag is enabled, GCC will refuse to compile code that could
be vulnerable to a string format security flaw. For more details, please see
https://fedorahosted.org/fesco/ticket/1185 page.

To understand why it is important to fix this, please see
https://fedoraproject.org/wiki/Format-Security-FAQ page.

How to fix this
---------------

The fix for these errors is quite simple. It's a matter of changing a
line like,

   printf(foo);

to read,

   printf("%s", foo);

That's it.

Please fix this issue in rawhide with a patch (which you should submit
to upstream to merge moving forward). Please do a new build with the
fix in rawhide. Other releases do not need to be directly fixed, but
there should be no harm in pushing out this fix/patch with other needed
changes to those branches.

In the event you don't fix this bug before the next mass rebuild,
provenpackagers may step in and update your package(s) to fix this
issue.

How reproducible
----------------

Build xdialog-2.3.1-11.fc20.src.rpm with "-Werror=format-security" flag to reproduce the problem.

To make this process easier, you can use a modified "redhat-rpm-config" package
from http://people.fedoraproject.org/~halfie/artifacts/redhat-rpm-config/ URL.

$ sha256sum redhat-rpm-config-9.1.0-56.fc20.*
faad7594b2080fe76497d0ce50808c905a93dd7b41c1defdde5ca57e3833d3d2  redhat-rpm-config-9.1.0-56.fc20.noarch.rpm
5aa9357174305c7285ffdbc92d7ffe1c07a8a95d5459b930461308f5aad75413  redhat-rpm-config-9.1.0-56.fc20.src.rpm

Comment 1 Conrad Meyer 2013-12-03 14:02:04 UTC
Yeah, this is a legit issue in Xdialog. We end up fprintf()ing a string with mostly trusted input, but also argv[0], which can be anything...

Comment 2 Conrad Meyer 2013-12-03 14:07:01 UTC
Here's the rawhide build: http://koji.fedoraproject.org/koji/taskinfo?taskID=6251879

Comment 3 Conrad Meyer 2013-12-03 14:14:42 UTC
Pushed and building in F20, F19.

Comment 4 Dhiru Kholia 2013-12-03 15:40:16 UTC
(In reply to Conrad Meyer from comment #1)
> Yeah, this is a legit issue in Xdialog. We end up fprintf()ing a string with
> mostly trusted input, but also argv[0], which can be anything...

Do we need a CVE for this?

Comment 5 Fedora Update System 2013-12-03 15:51:50 UTC
xdialog-2.3.1-13.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/xdialog-2.3.1-13.fc19

Comment 6 Fedora Update System 2013-12-03 15:52:06 UTC
xdialog-2.3.1-13.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/xdialog-2.3.1-13.fc20

Comment 7 Conrad Meyer 2013-12-03 15:58:21 UTC
(In reply to Dhiru Kholia from comment #4)
> (In reply to Conrad Meyer from comment #1)
> > Yeah, this is a legit issue in Xdialog. We end up fprintf()ing a string with
> > mostly trusted input, but also argv[0], which can be anything...
> 
> Do we need a CVE for this?

I don't think so. I think Xdialog just runs with the permissions of the user invoking it anyway.

Comment 8 Fedora Update System 2013-12-03 18:22:25 UTC
Package xdialog-2.3.1-13.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing xdialog-2.3.1-13.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-22652/xdialog-2.3.1-13.fc20
then log in and leave karma (feedback).

Comment 9 Tomas Hoger 2013-12-11 15:22:54 UTC
There is some discussion in the bodhi request on whether this update should be marked as security update rather than bug fix:

https://admin.fedoraproject.org/updates/FEDORA-2013-22697/xdialog-2.3.1-13.fc19

I'm moving the discussion here instead, as BZ is really a better place than bodhi for any longer explanation.

For this change, I do prefer to avoid calling it security unless we can demonstrate relevant security impacts.  This is rather unlikely to have security impact:

- Fedora glibc has mitigation in place to block exploiting format string issues for code execution.  Those attacks rely on %n format, which is what glibc checks for:

$ bash -c 'exec -a "%n" Xdialog'
%n: missing box option !
*** %n in writable segment detected ***
Aborted

Hence impact is limited to crash or information leak:

$ bash -c 'exec -a "%s%s%s%s%s%s" Xdialog'
%s%s%s%s%s%s: missing box option !
Segmentation fault

$ bash -c 'exec -a "%x%x%x%x%x%x" Xdialog'
%x%x%x%x%x%x: missing box option !
Xdialog v2.3.1 by Thierry Godefroy <xdialog> (v1.0 was
written by Alfred at Cyberone Internet <alfred.au>).
Xdialog home page available at: http://xdialog.dyns.net/

Usage: 312e7660dcda49c02078257825782578250 [<common options>] [<transient options>] <box option> ...
...

These impacts may be relevant in certain cases (when affected application is a daemon or setuid application), which does not seem to be the case here.

- Things like command line arguments (or argv[0]) in this case are generally considered trusted input when no dealing with setuid applications.  I can't think of a good way to make other user run this with odd argv[0] - they'd either have to run attacker's specially crafted command that sets crafted argv[0] (format string issue does not matter in this case), or run Xdialog using some very suspicious link.

Why does this all matter?  Because there are users who care about security advisories released (e.g. to prioritize security updates over non-security), and things like security fixes pushed as bug fixes or vice versa cause issues.

Comment 10 Fedora Update System 2013-12-12 02:53:51 UTC
xdialog-2.3.1-13.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2013-12-14 03:37:56 UTC
xdialog-2.3.1-13.fc20 has been pushed to the Fedora 20 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.