Skip to content

/v1/database/{db_name}/sql should go through onConnect and require Authorization #4556

@sean256

Description

@sean256

POST /v1/database/{db_name}/sql

This bypasses onConnect and doesn't require a token. The docs indicate that it should require authorization

POST /v1/database/{db_name}/call/{reducer}

Yet this requires a JWT and runs through onConnect where owners can validate the JWT any way they wish.

Proposal

The sql endpoint should have auth validation and run through onConnect. As it is now it's a potential security vulnerability, especially since the docs indicate otherwise.

With a growing number of developers coming to SpacetimeDB, who knows what unexpected use cases people may find for this amazing tool. Someone may unwittingly expose user data they thought they protected via auth and onConnect validation.

If this is truly intended behavior, then the docs should really be updated to call this out. I would error on the side of caution and just protect it all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions