Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 234079
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Robert Buchholz <rbu@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
yelp-2.22.1-format-string.patch Proposed patch patch Daniel Gryniewicz 2008-08-07 15:11 0000 574 bytes Details | Diff
yelp-2.20.0-r1.ebuild 2.20.0 bump ebuild for most arches text/plain Daniel Gryniewicz 2008-08-07 15:12 0000 1.69 KB Details
yelp-2.22.1-r2.ebuild 2.22.1 bump ebuild for amd64 text/plain Daniel Gryniewicz 2008-08-07 15:12 0000 2.06 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 234079 depends on: Show dependency tree
Bug 234079 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-08-06 12:07 0000
** Please note that this issue is confidential and no information should be
disclosed until it is made public, see "Whiteboard" for a date **

Aaron Grattafiori writes:
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

------- Comment #1 From Daniel Gryniewicz 2008-08-07 15:11:45 0000 -------
Created an attachment (id=162428) [details]
Proposed patch

------- Comment #2 From Daniel Gryniewicz 2008-08-07 15:12:18 0000 -------
Created an attachment (id=162430) [details]
2.20.0 bump ebuild for most arches

------- Comment #3 From Daniel Gryniewicz 2008-08-07 15:12:44 0000 -------
Created an attachment (id=162431) [details]
2.22.1 bump ebuild for amd64

------- Comment #4 From Daniel Gryniewicz 2008-08-07 15:13:56 0000 -------
Okay, here's a patch, and 2 ebuilds that apply it.  Most arches have 2.20.0
stable, but 2.22 is in the process of going stable (and amd64 has it stable). 
All arches that are going stable with 2.22 should test both (except amd64 which
only needs to test 2.22.1-r2).  Fortunately, the same patch applies to both.

------- Comment #5 From Robert Buchholz 2008-08-07 20:54:40 0000 -------
Thanks for patch and ebuild.

Arch Security Liaisons, please test the attached ebuild and report it stable on
this bug.
Target keywords : "alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"

CC'ing current Liaisons:
   alpha : yoswink, armin76
   amd64 : keytoaster, tester
    hppa : jer
     ppc : dertobi123
   ppc64 : corsair
   sparc : fmccor
     x86 : maekke, armin76

------- Comment #6 From Markus Meier 2008-08-10 19:43:04 0000 -------
yelp-2.22.1-r2 looks good on amd64/x86.

------- Comment #7 From Markus Rothe 2008-08-11 05:51:41 0000 -------
looks good on ppc64

------- Comment #8 From Raúl Porcel 2008-08-11 10:13:59 0000 -------
Looks okay on alpha/ia64/sparc

------- Comment #9 From Jeroen Roovers 2008-08-11 16:12:10 0000 -------
HPPA is OK.

------- Comment #10 From Tobias Scherbaum 2008-08-11 19:35:12 0000 -------
yelp-2.22.1-r2 okay for ppc

------- Comment #11 From Robert Buchholz 2008-08-15 08:52:55 0000 -------
Public via $URL. Please commit with the stable keywords gathered in this bug.

------- Comment #12 From Daniel Gryniewicz 2008-08-15 14:17:42 0000 -------
Committed.

------- Comment #13 From Robert Buchholz 2008-09-04 20:12:56 0000 -------
GLSA 200809-01

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug