Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 110554 - www-apps/{wordpress|ampache} include vulnerable snoopy library.
Summary: www-apps/{wordpress|ampache} include vulnerable snoopy library.
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High trivial
Assignee: Gentoo Security
URL: http://seclists.org/lists/fulldisclos...
Whiteboard: C? [ ? ] jaervosz
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-26 08:50 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2005-11-30 08:11 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
snoopy quick fix (snoopy.patch,528 bytes, patch)
2005-11-29 01:25 UTC, Micheal Marineau (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-10-26 08:50:46 UTC
It is reportedly included in the current wordpress release and likely also 
ampache. I don't know wether the packages are actually vulnerable to the 
exploit.
Comment 1 Thierry Carrez (RETIRED) gentoo-dev 2005-11-04 05:16:41 UTC
I know our auditors don't like web-apps but until we confirm vulnerability I'll
still set this to Auditing :)
Comment 2 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-11 01:06:25 UTC
CC'ing super stuart to see if that helps. 
Comment 3 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-14 14:06:57 UTC
CC'ing Renat. 
Comment 4 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-15 00:42:41 UTC
Wordpress and ampache both seems vulnerable. web-apps please advise.  
   
[09:36:02] <shellsage> Yes, wordpress uses snoopy.   
[09:36:33] <shellsage> If you download the archive, snoopy is   
in /wordpress/wp-includes/class-snoopy.php   
[09:36:34] <jaervosz_work> and I presume it is one of the vulnerable versions?   
[09:36:54] <shellsage> Yeah, it's version 1.0.   
   
[09:41:17] <shellsage> Yes ampache is vulnerable because it is distributed with   
snoopy-1.2, verified by looking at the file modules/amazon/Snoopy.class.php in   
the current release archive.   
Comment 5 Renat Lumpau (RETIRED) gentoo-dev 2005-11-27 06:50:45 UTC
We should probably involve superlag and marienam since they own the two
vulnerable packages.
Comment 6 Micheal Marineau (RETIRED) gentoo-dev 2005-11-27 14:28:07 UTC
I notified the ampache developer earlier today, he will put out a new release
soon. I also just found that this is exploitable via ampache via something like
the following request:

http://billybob/ampache/albums.php?cover=https://localhost/%60echo+'hello'+%3E+/tmp/test.txt.jpg%60&action=find_art&album_id=86

the above exuctes %60echo+'hello'+%3E+/tmp/test.txt.jpg%60
aka `echo 'hello' > /tmp/test.txt.jpg`
but this only worked for me if /usr/local/bin/curl existed as Snoopy hardcoded
that path in.

Comment 7 Thierry Carrez (RETIRED) gentoo-dev 2005-11-28 01:11:01 UTC
So ampache is not really vulnerable, unless you have curl in /usr/local/bin/...  

About Wordpress :

It has 
var     $curl_path              =       "/usr/bin/curl";
so unchecked calls to Snoopy->fetch would trigger the vulnerability. But
Snoopy->fetch is only called from _fetch_remote_file in rss-functions.php, which
in turn seems only used in fetch_rss (same file). This function is called only
on controlled input :

$rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='.
trailingslashit(get_option('home')) .'&partner=wordpress');
$rss = @fetch_rss('http://wordpress.org/development/feed/');
$rss = @fetch_rss('http://planet.wordpress.org/feed/');

so it doesn't look affected to me.
Comment 8 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-28 12:41:45 UTC
ampache-3.3.1.5 released to fix this issue. 
Comment 9 Micheal Marineau (RETIRED) gentoo-dev 2005-11-28 13:05:10 UTC
New ampache relase in CVS now.
Comment 10 Micheal Marineau (RETIRED) gentoo-dev 2005-11-28 23:43:41 UTC
Well, crap, I finally had time tonight to retest the new release of ampache and
the issue still exists. The current version of Snoopy is still vulnerable.

I'll poke at snoopy and see if I can get a more robust patch going.
Comment 11 Micheal Marineau (RETIRED) gentoo-dev 2005-11-28 23:50:18 UTC
The exact issue I am currently exploiting is that they escape " quotations but
it is sill possbile to execute code in back ticks ` within " quotes.

$safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid
shell access
exec($this->curl_path." -D \"$headerfile\"".$cmdline_params."
\"".$safer_URI."\"",$results,$return);
Comment 12 Micheal Marineau (RETIRED) gentoo-dev 2005-11-29 01:19:10 UTC
I also took a look at wordpress, and it seems ok to me. However in addition to
those controlled calls to fetch_rss listed in the bug, it is called from get_rss
and wp_rss, but I can't find a use of either of those two functions. If they are
used and I'm just missing it then they may provide a path in, but as long as
they aren't used all is well.

back to ampache, we tacked in a quick fix for snoopy and put out another release
which I will have in cvs shortly. I will attach the included patch for refrence.
Comment 13 Micheal Marineau (RETIRED) gentoo-dev 2005-11-29 01:25:39 UTC
Created attachment 73781 [details, diff]
snoopy quick fix

This was the quick and simple way to fix it. The old strtr calles that were
being used to make the string a little safer can probably be removed.

I also heard that this was also sent along to the wordpress developers so they
are aware of the issue.
Comment 14 Thierry Carrez (RETIRED) gentoo-dev 2005-11-29 02:33:15 UTC
Opened so that upstream can access the bug.

Note that Gentoo is as far as we can tell, unaffected by these (ampache has a
wrong curl hardcoded path and wordpress doesn't seem to use that function on
untrusted input).

So I'm not sure it warrants a security fix here...
Comment 15 Thierry Carrez (RETIRED) gentoo-dev 2005-11-30 08:11:37 UTC
Closing the bug as a non-security issue. Feel free to reopen/reassign if you
want to fix it.