in reply to cgi / Md5sum error
Hi Phweda,
I would suggest not calling an external program at all. Digest::MD5 has been in the Perl core since v5.8.
use Digest::MD5 qw/md5_hex/; print md5_hex("123456"), "\n"; __END__ e10adc3949ba59abbe56e057f20f883e
(Update: Corion was a bit quicker than me ;-) )
Unfortunately, your code appears to have multiple security holes. As unpleasant as it might be to hear, such holes are nowadays considered quite serious. If this CGI script is public-facing, or anyone untrusted is using it, I have to recommend against using this script.
I am also wondering about what sub ParseForm looks like. It's possible that some verification of the input might be done there that reduces the risk of the above, but until that is clear, it's better to err on the side of caution.
In regards to your question here: F447B20A7FCBF53A5D5BE013EA0B15AF is the MD5 sum of the string "123456\n".
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cgi / Md5sum error
by Phweda (Initiate) on Feb 12, 2017 at 09:56 UTC | |
|
Re^2: cgi / Md5sum error
by Phweda (Initiate) on Feb 12, 2017 at 11:29 UTC |