Skip to content
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

Relational updates circumvent database rules #2

Closed
JoeRoddy opened this issue Apr 12, 2023 · 0 comments
Closed

Relational updates circumvent database rules #2

JoeRoddy opened this issue Apr 12, 2023 · 0 comments
Assignees

Comments

@JoeRoddy
Copy link
Collaborator

JoeRoddy commented Apr 12, 2023

Given the following example rules:

const rules = { blog: { update: true }, user: { update: false } });

The user should not be able to execute the following query, bc user.update is false:

 db.blog.update({
      data: { body: 'updated', user: { update: { data: { email: 'updated' } } } },
      where: { id: testBlog1.id },
 }),

This does go through, however, because we aren't doing rule checking yet for relational actions on updates.

The following relational update actions are likely able to be executed when they shouldn't be:
connect, connectOrCreate, create, delete, deleteMany, disconnect, set, update, updateMany, upsert

These tests outline a few of the vulnerabilities.

@JoeRoddy JoeRoddy self-assigned this Apr 12, 2023
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

No branches or pull requests

1 participant