After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 306289 - Window titles used as Pango markup are not escaped
Window titles used as Pango markup are not escaped
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: selector
git master
Other All
: High critical
: ---
Assigned To: libwnck maintainers
libwnck maintainers
: 313881 324649 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-06-02 17:22 UTC by Jean-Yves Lefort
Modified: 2007-02-22 11:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
escapes window titles when they are used as Pango markup (557 bytes, patch)
2005-06-02 17:23 UTC, Jean-Yves Lefort
needs-work Details | Review
Updated patch following the tasklist.c route (4.11 KB, patch)
2005-12-21 16:19 UTC, Vincent Noel
needs-work Details | Review

Description Jean-Yves Lefort 2005-06-02 17:22:47 UTC
libwnck leaks Pango markup from window titles up to the window selector widget.

Please note that this bug allows a remote annoyer to crash the window menu
applet, for instance by inserting malicious Pango markup into the title of a web
page (for a demonstration, visit
http://people.freebsd.org/~jylefort/libwnck-test.html then click on the window
selector icon in your panel).

The fix is attached.
Comment 1 Jean-Yves Lefort 2005-06-02 17:23:51 UTC
Created attachment 47149 [details] [review]
escapes window titles when they are used as Pango markup
Comment 2 Elijah Newren 2005-06-02 17:47:28 UTC
Thanks for catching this.  The patch works, but I'm wondering if for consistency
we should fix this by not using markup; in tasklist.c we have the following code:

  text = wnck_task_get_text (task);
  if (text != NULL)
    {
      gtk_label_set_text (GTK_LABEL (task->label), text);
      if (wnck_task_get_demands_attention (task))
        {
          make_gtk_label_bold ((GTK_LABEL (task->label)));
          wnck_task_queue_glow (task);
        }
      else
        {
          make_gtk_label_normal ((GTK_LABEL (task->label)));
          wnck_task_stop_glow (task);
        }

(where make_gtk_label_* are local functions that use
pango_font_description_set_weight), while in selector.c we have

      window_name = wnck_selector_get_window_name (window);
      gtk_label_set_text (GTK_LABEL (item->label), window_name);

where wnck_selector_get_window_name() returns a string that possibly contains
markup.  (The lack of glowing in selector.c is part of bug 305979...)

Havoc, Mark, Vincent: thoughts?
Comment 3 Havoc Pennington 2005-07-19 00:12:26 UTC
agreed, it's better to make things bold via the make_gtk_label route probably
Comment 4 Elijah Newren 2005-12-21 00:22:22 UTC
*** Bug 324649 has been marked as a duplicate of this bug. ***
Comment 5 Vincent Noel 2005-12-21 16:19:59 UTC
Created attachment 56256 [details] [review]
Updated patch following the tasklist.c route

Here is an updated patch that mimics the logic in tasklist.c.
Comment 6 Vincent Untz 2005-12-27 16:00:57 UTC
Vincent: thanks for the patch, but it would really make more sense to have only one make_gtk_label_bold() and one make_gtk_label_normal(). Maybe putting them in util.[ch] is better ;-)
Comment 7 Elijah Newren 2005-12-27 16:37:28 UTC
Sorry for being slow to get back to you after asking you if you could fix this, Vincent.  Thanks to Vincent for responding for me.  Anyway, that patch works well and looks good to me other than the thing Vincent pointed out.  I have to disagree about util.h, though, as that turns out to be publically exported API (automatically included from libwnck.h too).  I'm not sure what the right place is--maybe private.h + util.c?  Maybe Vincent/Mark/Havoc knows the right place?
Comment 8 Vincent Untz 2005-12-31 12:18:48 UTC
private.h + util.c looks okay to me.
Comment 9 Elijah Newren 2006-01-21 20:07:32 UTC
I did the trivial move of make_gtk_label_* to util.c/private.h and then committed.

Thanks for the work, jylefort and Vincent!  Sorry for taking so long...
Comment 10 Vincent Untz 2007-02-22 11:18:53 UTC
*** Bug 313881 has been marked as a duplicate of this bug. ***