SQL Wildcard GRANT Privilege
Overview
GRANT ALL PRIVILEGES or GRANT * in SQL scripts gives a database user excessive permissions. Application database users should only have the minimum permissions required (SELECT, INSERT, UPDATE, DELETE on specific tables).
Remediation
Follow the principle of least privilege for database users. Grant only the specific operations needed on specific tables.
Vulnerable:
GRANT ALL PRIVILEGES ON *.* TO 'app_user'@'%';
Safe:
GRANT SELECT, INSERT, UPDATE, DELETE ON myapp.users TO 'app_user'@'%';