sigzero (email not shown publicly)
I am the proverbial "accidental" programmer. I have found that I really like Perl and programming so I am pursuing that route now.
I am the Debian systems administrator and junior Perl programmer for a company called Inspire.
sprint formats inputs and taint (Score:1)
qx{ sprintf "blah %s blah", $input }without taint checking the$inputfirst is not safe, never was, never should have been considered safe. If someone ever said "it's only a way to crash the program, no way to break in here", they were not listening to history. Running system commands with user input is always going to be a target of opportunity, you have to defend that in depth. You've got to check for buffer overrun (even if you can't see the buffer ) andBill
# I had a sig when sigs were cool
use Sig;
Re: (Score:1)
I think what’s happening is that they’re doing something like this:
where
$precisionderives from user input. This exposes Perl code to all the same format string vulnerabilities [wikipedia.org] that have commonly been found in C code. I’ve been pointing this out for a while now. I’m surprised that not more people have picked up on it.The right way to write that code, in the general case, is like so:
Re: (Score:2)
So I assume that you have long since reported this through perlbug and/or perl5-porters and since it's a security flaw also contacted the branch maintainers (Rafael and Nicholas) directly?
Re: (Score:1)
I think what he is saying is that it isn't a *core* Perl flaw but a flaw in programming methodology.
Core perl or methodology? (Score:1)
Bill
# I had a sig when sigs were cool
use Sig;
Re: (Score:1)
Huh? Should I also report the fact that
open FH, $foocan be used for mischief if$fooderives from user input?And this isn’t even as openly dangerous.
Cursory experimentation and a superficial browsing of the source suggests it’s not possible to corrupt
perl’s stack using printf [perl.org], so this isn’t a vulnerability inperl. It is very well possible to inject unexpected%ns into the format string to make an application fall over, though, so it definitely constitutes a vulnerability in PRe: Format (Score:1)
varargs, even worse than usual buffer stuff, Ouch. Thanks for the wikipedia link!I can see where prepping the stack for a varargs hack could be hard but not impossible with only a web client to work with.
Escaping or removing all relevant magic characters e.g.,
%is only one of the things one must do with user input before using it. Verifying syntax is as expected and size isn't absurd is also required for safety. (Some semantic checks may even be required to protect the backend from GIGO attacks, bBill
# I had a sig when sigs were cool
use Sig;
Re: format strings (Score:1)
Bill
# I had a sig when sigs were cool
use Sig;