Menu

Convex functions in AI-built apps: who can call them without logging in?
📰

Convex functions in AI-built apps: who can call them without logging in?

DEV Community: beginners·ProofForge | AI app security·3 days ago
#SOiu4r6j
#devtobeginners#devto#dev#function#functions
Long article (399 words) — no AI summary yet.
Reading 0:00
15s threshold

Convex gives an AI-built app a database and server functions with very little setup. The deployment URL ships in your browser code on purpose. That is fine. What matters is what the functions behind it will do for a stranger who calls them directly.

The risk in one sentence

A Convex query or mutation exported with the public helpers can be called by anyone who knows your deployment URL and the function name. If the function never checks who is calling, it works for everyone.

What to check

Every public function checks identity. In the function, look for a call to ctx.auth.getUserIdentity() and a clear error when it returns null. Generated code often skips this on "simple" list and delete functions.

Ownership, not just login. Being signed in is not enough. A mutation that takes a document id should confirm the document belongs to the caller before it edits or deletes it.

Private work uses internal functions.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.