Skip to content

Allow database creation with only create permissions#190

Open
lostcarpark wants to merge 1 commit into
LVerhulst4321:mainfrom
lostcarpark:DatabaseCreationPermissions
Open

Allow database creation with only create permissions#190
lostcarpark wants to merge 1 commit into
LVerhulst4321:mainfrom
lostcarpark:DatabaseCreationPermissions

Conversation

@lostcarpark

Copy link
Copy Markdown
Collaborator

The most recent database dumps contain statements that require root permissions to execute. These are around security definers for triggers and views, that would allow the trigger/view to access tables the user doesn't have access to. In our case, we are assuming one user for all database operations, as this is the only option for many shared hosting plans. This change ensures that a user with general "create" permissions but no other special privileges can create the databases.

For the future, it might be worth looking at providing creation scripts that set up the database in a way that the application user could have minimal permissions, so that if an attacker were to gain access to the SQL user (for example, through a SQL injection attack), the damage they could cause would be limited. However, I think this would have to be an optional creation script to not exclude low-cost shared hosting plans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant