That means remote users can do lots of nasty things like:
dwalin[17]:xauth list ~ dwalin.acm.uiuc.edu:0 MIT-MAGIC-COOKIE-1 3bbdd486c11d2ddfbb7111ab088e69c6 dwalin.acm.uiuc.edu/unix:0 MIT-MAGIC-COOKIE-1 3bbdd486c11d2ddfbb7111ab088e69c6The first line is the inet domain and the second line is the unix domain. We only care about the inet domain.
There are ways of doing this with rsh but that opens up other holes. See xrsh for more details.
You will need to do two things:
As a perl script:
A ksh equivalent would be:#!/usr/local/bin/perl set randomkey=`perl -e 'for (1..4) { srand(time+$$+$seed); printf("%4.5x", ($seed = int(rand(65536)))); } print "\n";'` xauth add `hostname`/unix:0 . $randomkey xauth add `hostname`:0 . $randomkey
Then start X with authority:#!/bin/ksh randomkey=$(echo $(( $RANDOM * $RANDOM * 2 ))) xauth add $(hostname)/unix:0 . $randomkey xauth add $(hostname):0 . $randomkey
xinit $HOME/.xinitrc -- /usr/bin/X11/X -auth $HOME/.Xauthority
top
pagers