what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

livejournal.txt

livejournal.txt
Posted Dec 28, 2005
Authored by Andrew Farmer

LiveJournal is susceptible to a javascript inclusion flaw.

tags | advisory, javascript
SHA-256 | 5ee1244723c6ee9a9237b7fe5f35b4e70c7c5c050a72fc882ab9c53b4cac9ddf

livejournal.txt

Change Mirror Download
SUMMARY
----------------------------------------------------------------------
The popular Livejournal[1] social networking software contained an
error which allowed for the inclusion of Javascript in user-supplied
content.

[1] http://www.livejournal.org/, http://www.livejournal.com/


BACKGROUND
----------------------------------------------------------------------
"LiveJournal is an online journal service with an emphasis on user
interaction."[2] It has historically had a relatively restrictive
attitude toward user-supplied web content, opting to not allow users
to include active content such as embedded plugins and scripts. This
attitude has generally prevented the creation and spread of malicious
content, such as the two worms which appeared on MySpace in recent
months. However, this position also requires that content be carefully
parsed - and a recent discovery showed that their code has its issues.

[2] http://www.livejournal.com/support/faqbrowse.bml?faqid=56


DESCRIPTION
----------------------------------------------------------------------
Livejournal parses all user-supplied HTML through a script called
cleanhtml.pl (located at livejournal/cgi-bin/cleanhtml.pl). All HTML
attributes containing the literal text 'javascript' are stripped by
default. However, if the cleancss option is enabled - which it is in
most installations, including the one at livejournal.com - style
attributes will have slashes stripped after the check for the text
'javascript' is made, causing a style property containing the text
'java\script' to be modified to 'javascript' and passed through. As
many web browsers allow "javascript:" to be used as a pseudo-URI, this
allows for the creation of content that will execute arbitrary script
code on a user's browser when viewed.

For example, the HTML content

<span style="background:url('javas\cript:(function
x(){alert("boo")})();');">test</span>

will be accepted by an unpatched LiveJournal installation; the slash
will be removed, causing a dialog to be displayed when the content is
viewed.


FIXES
----------------------------------------------------------------------
As of 7 Dec 2005, LiveJournal CVS contains a fix to this issue:
cleanhtml.pl now searches for the text 'javascript' in CSS *after*
stripping slashes:

> --- cgi-bin/cleanhtml.pl 22 Oct 2005 03:17:05 -0000 1.129
> +++ cgi-bin/cleanhtml.pl 7 Dec 2005 08:50:41 -0000 1.130
> @@ -319,7 +319,7 @@
> $hash->{$attr} =~ s/\\//g;
>
> # and catch the obvious ones ("[" is for
> things like document["coo"+"kie"]
> - foreach my $css ("/*", "[", qw(absolute
> fixed expression eval behavior cookie document window)) {
> + foreach my $css ("/*", "[", qw(absolute
> fixed expression eval behavior cookie document window javascript)) {
> if ($hash->{$attr} =~ /\Q$css\E/i) {
> delete $hash->{$attr};
> next ATTR;

All sites using the LiveJournal code are urged to upgrade, or apply
this patch, as soon as possible.


ACKNOWLEDGEMENTS
----------------------------------------------------------------------
The author would like to acknowledge Hoshikuzu Stardust (st4rdust at
gmail.com) for reporting a related issue involving the escaping of
control characters in CSS; this vulnerability was discovered during
experimentation and testing regarding that issue.


HISTORY
----------------------------------------------------------------------
Discovery: circa 5 Dec 2005

Vendor notified: 5 Dec 2005

Patch implemented: 7 Dec 2005

Public disclosure: 19 Dec 2005


AUTHOR
----------------------------------------------------------------------
Andrew Farmer is a student at Harvey Mudd College.

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close