Checking for safe paths

B

bill

Is there a module that one can use to portably check for the security
of a path? I know how to, e.g. untaint a Unix pathname, but it
would be nice if there were a module that did this portably. Also,
I imagine that there may be other ways for a pathname to be not
secure other than what can be detected with a general regexp (e.g.
a well-formed path may include a symbolic link inserted there for
nefarious purposes).

TIA for the cluebricks,

bill
 
B

bill

Is there a module that one can use to portably check for the security
of a path? I know how to, e.g. untaint a Unix pathname, but it
would be nice if there were a module that did this portably. Also,
I imagine that there may be other ways for a pathname to be not
secure other than what can be detected with a general regexp (e.g.
a well-formed path may include a symbolic link inserted there for
nefarious purposes).

Almost immediately after sending this in, it occurred to me that
the solution (or at least part of it) would be to translate the
path to a "real path" by first chdir to it and then using getcwd
to determining the real cwd.

bill
 
A

Anno Siegel

bill said:
Is there a module that one can use to portably check for the security
of a path? I know how to, e.g. untaint a Unix pathname, but it
would be nice if there were a module that did this portably. Also,
I imagine that there may be other ways for a pathname to be not
secure other than what can be detected with a general regexp (e.g.
a well-formed path may include a symbolic link inserted there for
nefarious purposes).

There is no such thing as a secure path independent of circumstances.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top