Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suidperl path disclosure #3732

Closed
p5pRT opened this issue Mar 22, 2001 · 4 comments
Closed

suidperl path disclosure #3732

p5pRT opened this issue Mar 22, 2001 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 22, 2001

Migrated from rt.perl.org#6511 (status was 'rejected')

Searchable as RT6511$

@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2001

From psz@maths.usyd.edu.au

suidperl can be used for path disclosure (to verify if a file exists when
the user has no access to the directories above). The error messages that
suidperl gives are too revealing​: in the examples below I expected a
uniform 'permission denied' or similar.

So far I have not been able to make suidperl do anything worse.

I do not have a patch to fix this problem​: looking in the source perl.c it
seems to me that this is specifically checked for...

Set things up as one user (e.g. root)​:

# pwd
/usr/users/system/root/ptest
# ls -ld
drwx------ 2 root daemon 512 Mar 23 09​:56 .
# ls -l
total 0
-rw------- 1 root daemon 0 Mar 23 09​:56 file
-rwS------ 1 root daemon 0 Mar 23 09​:56 sfile
#

As another (normal) user, use suidperl to disclose path info​:

milan> id
uid=1001(psz) gid=1001(amstaff) groups=101(canmail),102(cantelnet),103(canftp),104(canwww),105(canat)
milan> pwd
/usr/users/amstaff/psz
milan> foreach n ( nosuch file sfile )
? echo ''; echo Testing $n; suidperl /usr/users/system/root/ptest/$n
? end

Testing nosuch
Can't open perl script "/usr/users/system/root/ptest/nosuch"​: No such file or directory

Testing file
Script is not setuid/setgid in suidperl

Testing sfile
Permission denied.
milan>

Perl Info

Flags:
    category=core
    severity=high

Site configuration information for perl v5.6.0:

Configured by jimr at Wed Mar 29 14:15:48 EST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
    uname='osf1 lido.maths.usyd.edu.au v4.0 878 alpha '
    config_args='-Uusethreads -Dd_dosuid -Dusemymalloc=y -Uinstallusrbinperl -Dcf_email=jimr@maths.usyd.edu.au -Dperladmin=jimr@maths.usyd.edu.au -Dinstallprefix=/usr/local -Dprefix=/usr/local -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=define use64bitall=define uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O4', gccversion=
    cppflags='-std -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
    ccflags ='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=8, ptrsize=8, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
    libs=-ldbm -ldb -lm -liconv
    libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-rpath,/usr/local/lib/perl5/5.6.0/alpha-dec_osf/CORE'
    cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -msym -std -s -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.0:
    /usr/local/lib/perl5/5.6.0/alpha-dec_osf
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/alpha-dec_osf
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.6.0:
    HOME=/users/amstaff/psz
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/users/amstaff/psz/bin:/usr/local/bin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/sbin:/usr/sbin:.
    PERL_BADLANG (unset)
    SHELL=/bin/csh

@p5pRT
Copy link
Author

p5pRT commented Jul 30, 2003

From guest@guest.guest.xxxxxxxx

Ticket ID 6511 is listed as "resolved"; however I do not see this
issue solved in later perl version.

Please re-open bug.

Cheers, Paul

@p5pRT
Copy link
Author

p5pRT commented Mar 16, 2010

From @iabyn

Since setuid perl has been removed from 5.12.0, and the 5.10.x
maintenance branch is, erm, not being maintained, I'm marking this bug
as rejected, wontfix.

@p5pRT
Copy link
Author

p5pRT commented Mar 16, 2010

@iabyn - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant