dolthub / dolthub/dolt

Access denied for calling a sequrity-type DEFINER procedure

Open
#10,190 6 comments 0 reactions 1 assignee Claimed by @elianddb View on GitHub
bug correctness customer issue permissions sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

I am currently trying to set up a robust user system for my project where specific users are only granted exactly the permissions they need for executing their function, where I stumbled over this error: Seems the permission cascading only uses the permissions of the invoker of a procedure, even if explicitly specified as `SQL SECURITY DEFINER` (which is also the default in mysql).

```
$ mysql -u root -D dolt_testing
> CREATE TABLE t (id BINARY(2));
> CREATE PROCEDURE p () SQL SECURITY DEFINER SELECT id FROM t;
> CREATE USER testuser@localhost;
> GRANT EXECUTE ON PROCEDURE dolt_testing.p TO testuser@localhost;
> CALL p();
Empty set (0.00 sec)
>^Z
Bye
$ mysql -u testuser -D dolt_testing
> CALL p();
ERROR 1105 (HY000): Access denied for user 'testuser'@'localhost' to table 't'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.