]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Validate action parameter
authorGina Haeussge <osd@foosel.net>
Fri, 4 Jul 2008 19:41:14 +0000 (15:41 -0400)
committerGina Haeussge <osd@foosel.net>
Fri, 4 Jul 2008 19:41:14 +0000 (15:41 -0400)
Make sure the action request parameter only consists of a-z, A-Z, 0-9, _ or -
to discourage tampering with the following require_once.

darcs-hash:20080704194114-2b4f5-2bec30d7d40d7c7bd2c747ef3c805dbf720f6159.gz

index.php

index 53fd1bfe668c78d6a9944f50353e9b53c7736847..514146c78df1f3f7b97fae0e6d43d69a85b10f94 100644 (file)
--- a/index.php
+++ b/index.php
@@ -24,7 +24,7 @@ require_once(INSTALLDIR . "/lib/common.php");
 
 $action = $_REQUEST['action'];
 
-if (!$action) {
+if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
        common_redirect(common_local_url('public'));
 }