From 89ba820246978d01bfd56501a6a12f1ae5384090 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Tue, 16 Jul 2013 10:47:29 -0700 Subject: [PATCH] Escape argument to prevent SQL injection attack in User::getTaggedSubscriptions() This change escapes the $tag argument to prevent a SQL injection attack in User::getTaggedSubscriptions(). The parameter was not escaped higher up the stack, so this vulnerability could be exploited. --- classes/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/User.php b/classes/User.php index cd99a3dd4f..e8aaaf6a10 100644 --- a/classes/User.php +++ b/classes/User.php @@ -758,7 +758,7 @@ class User extends Managed_DataObject $profile = new Profile(); - $profile->query(sprintf($qry, $this->id, $tag)); + $profile->query(sprintf($qry, $this->id, $profile->escape($tag))); return $profile; }