Skip to content

Commit

Permalink
Fixed an sql injection vulnerability in groups.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
anuko committed Oct 20, 2021
1 parent 8f78ea2 commit 94fda0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions groups.php
Expand Up @@ -11,9 +11,16 @@
header('Location: access_denied.php');
exit();
}
if ($request->isPost() && !$user->isGroupValid($request->getParameter('group'))) {
header('Location: access_denied.php'); // Wrong group id in post.
exit();
if ($request->isPost()) {
$group_id = $request->getParameter('group');
if (!ttValidInteger($group_id)) {
header('Location: access_denied.php'); // Protection against sql injection.
exit();
}
if (!$user->isGroupValid($group_id)) {
header('Location: access_denied.php'); // Wrong group id in post.
exit();
}
}
// End of access checks.

Expand Down
2 changes: 1 addition & 1 deletion initialize.php
Expand Up @@ -12,7 +12,7 @@
// Disable displaying errors on screen.
ini_set('display_errors', 'Off');

define("APP_VERSION", "1.19.30.5601");
define("APP_VERSION", "1.19.31.5602");
define("APP_DIR", dirname(__FILE__));
define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib");
define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates");
Expand Down

0 comments on commit 94fda0c

Please sign in to comment.