]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Escape argument to User::getTaggedSubscribers() to preven SQL injection
authorJoshua Wise <jwise@nvidia.com>
Tue, 16 Jul 2013 17:43:56 +0000 (10:43 -0700)
committerEvan Prodromou <evan@e14n.com>
Tue, 16 Jul 2013 17:43:56 +0000 (10:43 -0700)
This change escapes the argument to User::getTaggedSubscribers() to
prevent SQL injection attacks.

Both code paths up the stack fail to escape this parameter, so this is
a potential SQL injection attack.

classes/User.php

index 8d21d2bc19f305b3e5a5d9946f99cd8df368e986..cd99a3dd4fe5d9034b2bb0e0aeb0c185e8265195 100644 (file)
@@ -736,7 +736,7 @@ class User extends Managed_DataObject
 
         $profile = new Profile();
 
-        $cnt = $profile->query(sprintf($qry, $this->id, $tag));
+        $cnt = $profile->query(sprintf($qry, $this->id, $profile->escape($tag)));
 
         return $profile;
     }