format string vulnerabilty

Bug #254860 reported by Aaron Grattafiori
252
Affects Status Importance Assigned to Milestone
Yelp
New
Undecided
Unassigned
yelp (Ubuntu)
Fix Released
Medium
Kees Cook
Gutsy
Fix Released
Medium
Kees Cook
Hardy
Fix Released
Medium
Kees Cook

Bug Description

Binary package hint: yelp

Gnome's help program "yelp" is affected by a classic format string vulnerability
when reporting an invalid URI using a gtk_message_dialog. The function gtk_message_dialog_format_secondary_markup()
is called without a format string.

Details:
--------
After specifying an invalid URI, using ftp:// or file:// (or even no URI handler at all!)
An error message saying "The requested URI %s is invalid" is created using on line 1008 of yelp-window.c which
passes the gchar string into the window_error function located at 1129 of the same file.
The GTK dialog box is then created insecurely by *not* using a format string at line 1156 of yelp-window.c.

The function prototype for gtk_message_dialog_format_secondary_markup is:
void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog,
                                                         const gchar *message_format,
                                                                                ...);
where message_format is a "printf()-style markup string".
see: http://library.gnome.org/devel/gtk/2.12/GtkMessageDialog.html#gtk-message-dialog-format-secondary-markup
Incorrect/vulnerable usage here:
http://svn.gnome.org/viewvc/yelp/trunk/src/yelp-window.c?revision=3145&view=markup
You can see the code was changed "cleaned up" from properly using a format string, to its removal here:
http://svn.gnome.org/viewvc/yelp/trunk/src/yelp-window.c?annotate=2848#l1130

PoC:
----
yelp ftp://%08x.%08x.%08x.%08x.%08x.%08x
yelp %x%x%x%x%x%x://
yelp %08x%08x

Impact:
------

Because of yelp's network capability, this vulnerably may be remotely exploitable via minimal user-assistance in Firefox, Evolution and other programs with the 'man' or 'ghelp' URIs registered. Evolution will prompt the user for confirmation (which displays the program and arguments) but sadly Firefox 3.0 does not allow for preview of the arguments being passed. (I think all arguments being passed to applications via Firefox or whatever program should be displayed.
This seems like a regression in security from Firefox 2)
This vulnerability could be exploited to execute arbitrary code with the user's privileges and possible user-assisted execution of arbitrary code by clicking on a malicious link.

Effected Versions:
---------
All newer than 2.19.90

Fix:
----------
Patch the function call to use a format string per GTK+ documentation.
Similar to the properly used call gtk_message_dialog_format_secondary_text()
at line 581 of yelp-print.c

-Aaron Grattafiori

Related branches

CVE References

description: updated
Revision history for this message
Kees Cook (kees) wrote :

Thanks for the report. I've confirmed the problem, and we will start the process of assigning a CVE, and coordinating with upstream to get a fix out to all the distros.

Changed in yelp:
assignee: nobody → kees
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Aaron Grattafiori (cogitate) wrote :

Thanks for the quick response Kees. Just to update launchpad:
A patch is available: http://bugzilla.gnome.org/attachment.cgi?id=115890&action=view

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package yelp - 2.23.1-0ubuntu3

---------------
yelp (2.23.1-0ubuntu3) intrepid; urgency=low

  * SECURITY: New patch, 60_format-string, fixes format string vulnerability;
    GNOME #546364; from SVN r3173; LP: #254860.

 -- Loic Minier <email address hidden> Wed, 13 Aug 2008 14:51:35 +0200

Changed in yelp:
status: Confirmed → Fix Released
Revision history for this message
Kees Cook (kees) wrote :

This was assigned CVE-2008-3533

Kees Cook (kees)
Changed in yelp:
assignee: nobody → kees
status: New → Fix Committed
assignee: nobody → kees
importance: Undecided → Low
status: New → Fix Committed
importance: Low → Medium
importance: Undecided → Medium
Revision history for this message
Kees Cook (kees) wrote :
Changed in yelp:
status: Fix Committed → Fix Released
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.