-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supabase Linter reports warnings with default Ash functions #396
Comments
Hmmm...I'm not familiar with setting search paths for functions, but if we can confirm it has no problematic behavior I see no reason not to adjust our migration code to do so. Only for future users, though. So we'd modify the existing code, not add a new version that forces everyone to do another migration. |
Cool, I'll work on a PR when I can. What would give you confidence that this works? All tests passing in this lib? |
Honestly just a snippet explaining why the lint error exists and what modifying search path for the function does, and why the function triggered it would be sufficient 😆. I can do my own research on that front if necessary. It seems like something to do with the fact that the function does a |
It appears to be a very minor hardening step. I just found this rationale in the linter: https://supabase.github.io/splinter/0011_function_search_path_mutable/
And here's a related CVE from older versions of Postgres: https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058%3A_Protect_Your_Search_Path I also can't see anything that Ash is calling that would be a problem: all the functions are I won't push this any further and happy for you to delete the issue if you think it's not worth adding the hardening for. But I can also confirm that the modified functions (e.g. see below) work for me.
|
Based on all the information here, it makes sense that we should set a search path for our functions in that case. 👍 PRs welcome! |
I'll issue one this week. The change is trivial but I want to do some testing, spin up new apps etc to see it all working. |
Describe the bug
The functions installed by Ash generate these warnings when used with a Supabase DB.
(I naively assume these warnings have some merit if included with a large project like Supabase)
To Reproduce
Expected behavior
No errors or warnings are reported.
** Runtime
Additional context
These warnings are gone if you modify functions like so:
scope_test_1 gives a warning, _2 does not.
This is a very naive test though, I don't know enough yet about search paths to know how this might interfere with Ash functions, especially if schema multitenancy is used.
I'm reporting this now, and would be happy to pursue a PR later in the week if you think it's worth it.
The text was updated successfully, but these errors were encountered: