<div dir="ltr">Hi all,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 2:04 PM, Madhura Jayaratne <span dir="ltr"><<a href="mailto:madhura.cj@gmail.com" target="_blank">madhura.cj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Following queries are used to assess whether the logged in user has super, create user and grant privileges respectively. See [1]<br clear="all"><div><br></div><div>SELECT 1 FROM mysql.user LIMIT 1<br></div></div></div></blockquote><div><br></div><div>This is used to see if user is phpMyAdmin superuser and for phpMyAdmin, the super user is the user having read access to `mysql.user`.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div><div>SELECT 1 FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE PRIVILEGE_TYPE = 'CREATE USER' LIMIT 1</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>SELECT 1 FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE IS_GRANTABLE = 'YES' LIMIT 1<br> <br></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>However, if I create a user with all global privileges except for 'GRANT', 'SUPER', and 'CREATE USER' privileges all the above queries return 1 since the queries does not check for the grantee column. Rows corresponding to root user make all these queries return 1.</div></div></div></blockquote><div><br>Similarly, USER_PRIVILEGES tells about the global privileges of current 
logged in user. Even if user is not having Global GRANT privilege he can
 still grant privileges to user (those privileges which he has), So, he is kind of a GRANT user for phpmyadmin.<br><br></div><div>I don't know why, but I created a similar user that you have created but using that new user can still create more users using that new user.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>This obviously looks a bug to me. I'm writing to make sure that I'm not missing out on something obvious.</div></div></div></blockquote><div><br></div><div>Correct me if I am wrong anywhere. I am doing some more research on it.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>[1] <a href="https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/DatabaseInterface.class.php#L1917" target="_blank">https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/DatabaseInterface.class.php#L1917</a></div><span class=""><font color="#888888"><div><br></div><div><br></div>-- <br>Thanks and Regards,<div><br></div><div>Madhura Jayaratne<br><div><br></div></div>
</font></span></div></div>
<br>------------------------------------------------------------------------------<br>
Comprehensive Server Monitoring with Site24x7.<br>
Monitor 10 servers for $9/Month.<br>
Get alerted through email, SMS, voice calls or mobile push notifications.<br>
Take corrective actions from your mobile device.<br>
<a href="http://p.sf.net/sfu/Zoho" target="_blank">http://p.sf.net/sfu/Zoho</a><br>_______________________________________________<br>
Phpmyadmin-devel mailing list<br>
<a href="mailto:Phpmyadmin-devel@lists.sourceforge.net">Phpmyadmin-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Regards,<br>Chirayu Chiripal<br><a href="https://chirayuchiripal.wordpress.com/" target="_blank">https://chirayuchiripal.wordpress.com/</a><br></div>
</div></div></div>