hi,
I'm using taint mode and would like to taint valid usernames and passwords. basically i'm not sure what to allow and what not to allow. Should passwords only allow alphabetical and numerical characters? or can a password be "This_is-my|pass,,word"
I'll be storing the password in a MD5 hash in mysql db that field is VARCHAR(16). So If i was to do a regex for the password input from the user, would I allow just alphabetical and numerical characters? If yes is this the proper regex/taint method:
$user_pass = $INPUT->param{'pass'};
if ($user_pass =~ /^[A-Za-z0-9]+$/ && length($user_pass) < 17) {
$user_pass = $1;
}
Are there any implications to what I'm trying to do? I'm not to strict with password rules too, the only one I have is for the members password to be 6 charcters or longer.
What about the username? If I want to allow a username like "Perl_Monks" how can I make the proper regex for it? Is the "_" or underscore character part of the
A-Za-z0-9 patter?
Or am I worrying about this issue too much? Basically I want to secure the script as much as possible so no one can enter any unwanted input to my script.
ty
tanger
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.