Earlier quoted context omitted.
I think the problem here is the fact that tainted variables (user input) are used to execute shell commands. it doesn't matter if that's $_POST or $_GET, both of these are user input and therefore these are huge vulnerabilities.
I'm pretty sure GP was being sarcastic.
Exec($_GET
101–110 of 131 posts
Re: Exec($_GET
#102Earlier quoted context omitted.
in_array(needle, haystack) PHP with its argument ordering strikes again :)
... actually, if(!IDEMPOTENT_COMMANDS[$cmdname]) { ... would do, and, assuming dictionary lookups are optimised, is possibly faster.
if (! isset(IDEMPOTENT_COMMANDS[$cmdname]))
otherwise you'll get an undefined index notice :)Re: Exec($_GET
#103Earlier quoted context omitted.
... actually, if(!IDEMPOTENT_COMMANDS[$cmdname]) { ... would do, and, assuming dictionary lookups are optimised, is possibly faster.
actually, if (! isset(IDEMPOTENT_COMMANDS[$cmdname])) otherwise you'll get an undefined index notice :)
Re: Exec($_GET
#104Re: Exec($_GET
#105Re: Exec($_GET
#106Yes:
Something like this?
This will filter user input with regular expression and save value in session memory. This will return value even when user inputted value is not imported. When is, new value is updated in session memory.
function __var($name, $pattern, $value, $default = null) {
# change
if ($value !== null && preg_match($pattern, $value)) {
$_SESSION['__var'][$name] = $value;
}
# reset
if ($_GET['reset'] == $name) {
unset($_SESSION['__var'][$name]);
}
# deafult
if ($_SESSION['__var'][$name] == null && $default != null) {
$_SESSION['__var'][$name] = $default;
}
# return
return $_SESSION['__var'][$name];
}Re: Exec($_GET
#107"We've found 99,841 code results" Someone should write a script that automatically raises an issues for each line and each project, it's probably possible, but I'm chronically lazy.
Instead of half-assing the problem, please dedicate 10 minute of your life to look in, analyze & report one or two of the problems you find.
Also explain why you think this is an security issue.
You will:
* help someone out by pointing out an issue
* hopefully educate the person how to write better code
* educate yourself in reading and understanding others spaghetti codeRe: Exec($_GET
#108Re: Exec($_GET
#109Earlier quoted context omitted.
I really, really, really want to post on their issue tracker, but maybe I shouldn't. There's no guarantee the person grading the project will care, either.
You should. But be factual. No point in bringing the attitude.
Re: Exec($_GET
#110This needs to be quoted to return decent results: https://github.com/search?q=%22exec%28%24_GET%22&type=Code&r... Otherwise there are way too many false positives. Still, 188 results is pretty awful.