develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #114908] rename wrongly considered insecure in an elsif clause

From:
mhasch @ cpan . org
Date:
September 14, 2012 14:54
Subject:
[perl #114908] rename wrongly considered insecure in an elsif clause
Message ID:
rt-3.6.HEAD-11172-1347643445-1358.114908-75-0@perl.org
# New Ticket Created by  mhasch@cpan.org 
# Please include the string:  [perl #114908]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114908 >



This is a bug report for perl from mhasch@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.16.1.


-----------------------------------------------------------------
Perl seems to consider "rename" to be an insecure operation in
taint mode if it happens to be called in an elsif clause chained
after an if clause involving something tainted.  This seems to
be the case in perl5.8.9, perl5.10.1, perl5.14.2 and perl5.16.1.

A test for this is attached below.  I thank Bram on #p5p for
help in boiling down the test case.

-Martin
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.16.1:

Configured by ***** at Fri Aug 10 10:33:58 CEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=2.6.32-5-686, archname=i686-linux-64int-ld
    uname='linux ******* 2.6.32-5-686 #1 smp sun may 6 04:01:19 utc 2012 i686 gnulinux '
    config_args='-Dprefix=/opt/perl516 -Duse64bitint -Duselongdouble -Dperladmin=none -Dusevfork=false -de'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.3.5', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib64
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.11.3.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.16.1:
    /opt/perl516/lib/site_perl/5.16.1/i686-linux-64int-ld
    /opt/perl516/lib/site_perl/5.16.1
    /opt/perl516/lib/5.16.1/i686-linux-64int-ld
    /opt/perl516/lib/5.16.1
    /opt/perl516/lib/site_perl/5.16.0/i686-linux-64int-ld
    /opt/perl516/lib/site_perl/5.16.0
    /opt/perl516/lib/site_perl
    .

---
Environment for perl 5.16.1:
    HOME=/home/******
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/opt/perl516/bin:/home/******/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About