Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351375 - gnome-extra/gnome-games has dysfunctional group setuid protection for highscores
Summary: gnome-extra/gnome-games has dysfunctional group setuid protection for highscores
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 432848
  Show dependency tree
 
Reported: 2011-01-11 16:48 UTC by emil karlson
Modified: 2013-07-26 18:42 UTC (History)
1 user (show)

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


Attachments
possible changes to gnome-games-2.30.2-r1.ebuild (gnome-games-2.30.2-r1.ebuild.diff,1.05 KB, patch)
2011-01-13 17:43 UTC, emil karlson
Details | Diff
comply to GAMES_STATEDIR (gnome-games-policy.diff,1.14 KB, text/plain)
2011-03-06 21:01 UTC, emil karlson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description emil karlson 2011-01-11 16:48:26 UTC
Gnome games have group setuid protected highscore files. Gentoo uses group games for setuid protection, which is a group required to play other games and therefore the protection doesn't work for people in games group.

$ ll /var/lib/games/mahjongg.ziggurat.scores
-rw-rw-r-- 1 games games 0 Dec 11 00:02 /var/lib/games/mahjongg.ziggurat.scores
jkarlson@schur: ~
$ ll /usr/bin/mahjongg 
-r-xr-s--x 1 root games 127720 Dec 11 00:02 /usr/bin/mahjongg


Reproducible: Always
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-11 17:20:39 UTC
I have no idea what your problem is, please be more descriptive.
Comment 2 emil karlson 2011-01-11 18:20:38 UTC
Gnome-games are setuid group, so the gain group privileges of the owning group to write highscores.

This group privilege is coincidentally the one used used for restrict general 
access to other games, now all members of games group can write highscores.

The highscore access group should be something that most users are not a member of.
Comment 3 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-12 09:32:12 UTC
I still don't understand why you want gnome games to be differently handled than any other games in gentoo ?
Comment 4 emil karlson 2011-01-12 19:15:18 UTC
First of all other games are not playable by all as a rule, only the games group.
-rwxr-x--- 1 root games 14209568 Sep 28 22:34 /usr/games/bin/wesnoth

Also this allows users in games group to unexpectedly to feed arbitrary data to a program running with the privileges of an another user. Though not a probable security issue, but doesn't seem like a good practice to me. As far as I know other games do not use global high scores.

This is comparable to having world writable files, which is a QA-issue, if you  do not assume that people in games group are trusted users.

Alternatives known to me:
1) Current situation: almost world writable files, and games playable by people not in games group (non-compliance to games project).

2) Write protect high score files: non-functional games.

3) Switch game executables' and high score files' group owner to eg. gamehighscores: games work as in other distros, non-compliance to games project.

4) Remove others' execution privileges for gnome-games executables: almost world writable files, at least partial compliance to games project.
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-01-12 23:31:50 UTC
Ok I see. 
We have to either choose for shared high-scores or no high-scores at all.
We are not going to introduce another group for gnome games only, it would not make sense.
We must fix permissions of executables but for the rest there is nothing much we can do.
Comment 6 emil karlson 2011-01-13 17:43:24 UTC
Created attachment 259731 [details, diff]
possible changes to gnome-games-2.30.2-r1.ebuild
Comment 7 emil karlson 2011-01-13 17:44:42 UTC
Gnomine seems to survive the missing highscore files, it only says that you didn't make it to the highscore (which is displayed as empty).
Comment 8 Pacho Ramos gentoo-dev 2011-03-06 11:44:28 UTC
I disagree with losing all highscore files. If I don't misremember, the usage of "games" group was oriented to add only "trusted" users to it due problems like this (writing allowed outside their home), then, fixing permissions would be enough to make gnome-games behave like the rest of games
Comment 9 emil karlson 2011-03-06 21:01:18 UTC
Created attachment 265003 [details]
comply to GAMES_STATEDIR

At least we should comply to GAMES_STATEDIR, which seems to allow these sorts of files eg. diff attached.
Comment 10 Pacho Ramos gentoo-dev 2011-06-19 11:58:02 UTC
I would like to have the opinion of other team members on this. Thanks :-)
Comment 11 yaverot 2011-07-08 21:02:54 UTC
This appears to be the bug for permissions set wrong for gnome-games, it looks like you're working on a more compressive solution, but here's a work-around until then:

cd /usr/bin
ls -la | grep games | awk '{print$9}' | xargs chmod o-x

sloppy? yes. brute-force? definitely. 
Fixes executable permissions, so that only "group games" users can play games? Affirmative.
Comment 12 Pacho Ramos gentoo-dev 2013-07-26 18:42:26 UTC
should be solved in 3.8 (at least, it relies on games.eclass much more)