Skip to content

/rpc/functions callable from web_anon (security issue?) #1741

Answered by wolfgangwalther
phpwutz asked this question in Q&A
Discussion options

You must be logged in to vote

This is a postgres permissions thing. Any endpoint that the anonymous user has privileges for will be accessible. The public schema is accessible by any postgres user by default - and any function in that schema will be callable for the anonymous user.

Here are some guidelines for how to prevent that:

  • Do not use the public schema as db-schema. Use another schema specifically created for it, e.g. api.
  • Do not install extensions into the exposed schema. If you switch to db-schema=api, you can install those extensions into public. This will prevent the exposure of many of the functions of that extension as RPCs.
  • Add db-extra-search-path=public to be able to access those extensions without pr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by wolfgangwalther
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1730 on January 25, 2021 15:17.