Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 60525 - dev-lang/ruby libruby1.8: CGI::Session creates files insecurely
Summary: dev-lang/ruby libruby1.8: CGI::Session creates files insecurely
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All All
: High critical (vote)
Assignee: Gentoo Security
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard: B4 [glsa] jaervosz
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-15 23:52 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2011-10-30 22:38 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-08-15 23:52:31 UTC
From Debian bug:

Version: 1.8.1+1.8.2pre1-3
Severity: grave
Tags: security upstream
Justification: user security hole

Hi,

I just noticed that CGI::Session's FileStore (and presumably PStore)
implementations store session information insecurely.  They simply
create files, ignoring permission issues.  I assume the only thing
affecting permissions is the value of umask.  For both my user, as
well as www-data, session files end up in /tmp with permission
0644.  This is quite bad; an unsuspecting user might be storing
sensitive information in session variables, assuming that the class
stores data securely.

The following script illustrates the problem:

#!/usr/bin/ruby -w

require 'cgi'
require 'cgi/session'

cgi = CGI.new('html4')
session = CGI::Session.new(cgi, 'prefix' => 'blah_')
Kernel.system("ls -l " + Dir.glob("/tmp/blah_*").join(" "))
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-08-15 23:56:03 UTC
Mamoru this seems to affect the versions in portage will you look into it and provide an updated ebuild if necessary?
Comment 2 Philipp Kern 2004-08-19 03:48:00 UTC
For more information read: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=260779

I personally use Ruby for web development and stumpled over this by myself. Shell users could read all the session data. This by itself is not a security hole, as I could choose which data to save, but still it allows an attacker to gather the information which is stored in the end.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/23952 contains a patch for this problem.

I would propose a severity increase, as Debian put out DSA 537-1 with CAN-2004-0755 assigned addressing this issue, please react please fix also the 1.8.1 tree currently in stable. Thank you.
Comment 3 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-08-19 05:46:29 UTC
Thanks to the pointers, Philipp. As for the patch, ruby-1.8.2_pre2 includes it. Also, I added ruby-1.6.8-r11 yesterday, which is a snapshot of 20040727 and contains a fix for the bug. However, ruby-1.8.0 is the last version which compiles on ia64 (bug #48824), so I'll make ruby-1.8.0-r7 with the patch tonight. After that, I'll open a bug to let arch maintainers mark ruby-1.6.8-r11, ruby-1.8.0-r7 and ruby-1.8.2_pre2 stable.
Comment 4 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-08-19 07:10:13 UTC
Mamoru just post on this bug what needs to be marked stable and cc the relevant arches.
Comment 5 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-08-19 10:10:40 UTC
okay.

All arch devs, due to the security issue described on this bug, the following ebuilds need to be marked stable. (I've just marked them stable on x86)

* dev-lang/ruby-1.6.8-r11
* dev-lang/ruby-1.8.0-r7 (for ia64)
* dev-lang/ruby-1.8.2_pre2
* dev-ruby/ruby-config-0.3 (dependency of ruby-1.8.2_pre2)

Please test and mark them stable. Thanks in advance.
Comment 6 Chris White (RETIRED) gentoo-dev 2004-08-19 10:32:14 UTC
Correcting whiteboard to stable.
Comment 7 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-08-19 11:26:07 UTC
stable on ppc
Comment 8 Bryan Østergaard (RETIRED) gentoo-dev 2004-08-19 18:35:52 UTC
Stable on alpha.
Comment 9 Jason Wever (RETIRED) gentoo-dev 2004-08-21 21:32:47 UTC
Stable on sparc
Comment 10 SpanKY gentoo-dev 2004-08-22 22:27:20 UTC
marked arm/hppa stable
Comment 11 Danny van Dyk (RETIRED) gentoo-dev 2004-08-25 14:01:14 UTC
stable on amd64
Comment 12 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-08-28 16:02:13 UTC
Security this seems to be a B4 please vote on GLSA
Comment 13 Thierry Carrez (RETIRED) gentoo-dev 2004-09-02 06:38:49 UTC
I think we need one. It's an information leak, but it's a very interesting one. And Debian did one :)
Comment 14 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-09-03 12:25:59 UTC
GLSA 200409-08

ia64, mips, ppc, s390 please mark stable to benifit from GLSA.
Comment 15 Tom Gall (RETIRED) gentoo-dev 2004-10-09 20:54:02 UTC
1.8.2_pre2 marked stable on ppc64, thanks!
Comment 16 Hardave Riar (RETIRED) gentoo-dev 2004-10-17 22:30:14 UTC
Stable on mips.