I'm working on an application that requires some user-uploaded (image) thumbnail files. Accomplishing that part is simple enough and has already been accomplished.

Now, I'm trying to configure my mod_perl server to allow those directories when PerlTaintCheck is enabled.

I've read through various parts of Practical mod_perl to determine the appopriate settings, but what seemed to be the proper configuration is still warning me of insecure path dependencies ...

I've tried the following in my httpd.conf (within the VirtualHost section):

PerlSetVar RAW_IMAGES /home/httpd/server_root/rawimages PerlSetVar FINAL_IMAGE_DIR /home/httpd/server_root/graphics/uploaded_i +mages PerlSetEnv PATH /home/httpd/server_root/rawimages:/home/httpd/server_r +oot/graphics/uploaded_images PerlTaintCheck On
but i still get: Insecure dependency in open while running with -T switch when I'm trying to write out a thumbnailed image....

Doesn't the PATH setting include filesystem locations that are acceptable for write access?

This is the exact call that fails: open( NEWIMG, "+>$thumbName" ) or croak "Can't open new imagefile: ($thumbName)  $! \n"; I've added a warn() just before the open, and the attempted image name: /home/httpd/server_root/graphics/uploaded_images/679_lg.jpg

that filesystem location is clearly in the PATH setting ... what is it I'm missing?


In reply to PerlTaintCheck and configuration for secure paths by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.