Supabase engineer here working on MCP. A few weeks ago we added the following mitigations to help with prompt injections: - Encourage folks to use read-only by default in our docs [1] - Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data [2] - Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] We noticed that t…
Supabase MCP can leak your entire SQL database
51–60 of 502 posts
Re: Supabase MCP can leak your entire SQL database
#52Supabase engineer here working on MCP. A few weeks ago we added the following mitigations to help with prompt injections: - Encourage folks to use read-only by default in our docs [1] - Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data [2] - Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] We noticed that t…
Re: Supabase MCP can leak your entire SQL database
#53Supabase engineer here working on MCP. A few weeks ago we added the following mitigations to help with prompt injections: - Encourage folks to use read-only by default in our docs [1] - Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data [2] - Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] We noticed that t…
I think this article of mine will be evergreen and relevant: https://dmitriid.com/prompting-llms-is-not-engineering
> Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2]
> We noticed that this significantly lowered the chances of LLMs falling for attacks - even less capable models like Haiku 3.5.
So, you didn't even mitigate the attacks crafted by your own tests?
> e.g. model to detect prompt injection attempts
Adding one bullshit generator on top another doesn't mitigate bullshit generation
Re: Supabase MCP can leak your entire SQL database
#54Earlier quoted context omitted.
There are no prepared statements for LLMs. It can't distinguish between your instructions and the data you provide it. So if you want the bot to be able to do certain actions, no prompt engineering can ever keep you safe. Of course, it probably shouldn't be connected and able to read random tables. But even if you want the bot to "only" be able to do stuff in the ticket system (for instance setting a priority) you're…
Why can't the entire submitted text be given to an LLM with the query: Does this contain any Db commands?"?
Re: Supabase MCP can leak your entire SQL database
#55It should be a best practice to run any tool output - from a database, from a web search - through a sanitizer that flags anything prompt-injection-like for human review. A cheap and quick LLM could do screening before the tool output gets to the agent itself. Surprised this isn’t more widespread!
Re: Supabase MCP can leak your entire SQL database
#56Earlier quoted context omitted.
Yeah, I am surprised at the lack of real-world exploits too. I think it's because MCPs still aren't widely enough used that attackers are targeting them. I don't expect that will stay true for much longer.
Could be that the people most likely to mainline MCP hype with full RW permissions are the least likely to have any auditing controls to detect the intrusion.
Re: Supabase MCP can leak your entire SQL database
#57Supabase engineer here working on MCP. A few weeks ago we added the following mitigations to help with prompt injections: - Encourage folks to use read-only by default in our docs [1] - Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data [2] - Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] We noticed that t…
Then MCP and other agents can run wild within a safer container. The issue here comes from intermingling data.
Re: Supabase MCP can leak your entire SQL database
#58This is just XSS mapped to LLMs. The problem, as is so often the case with admin apps (here "Cursor and the Supabase MCP" is an ad hoc admin app), is that they get a raw feed of untrusted user-generated content (they're internal scaffolding, after all). In the classic admin app XSS, you file a support ticket with HTML and injected Javascript attributes. None of it renders in the customer-facing views, but the admin v…
Re: Supabase MCP can leak your entire SQL database
#59Supabase engineer here working on MCP. A few weeks ago we added the following mitigations to help with prompt injections: - Encourage folks to use read-only by default in our docs [1] - Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data [2] - Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] We noticed that t…
> Wrap all SQL responses with prompting that discourages the LLM from following instructions/commands injected within user data I think this article of mine will be evergreen and relevant: https://dmitriid.com/prompting-llms-is-not-engineering > Write E2E tests to confirm that even less capable LLMs don't fall for the attack [2] > We noticed that this significantly lowered the chances of LLMs falling for attacks - ev…
It's bullshit all the way down. (With apologies to Bertrand Russell)
Re: Supabase MCP can leak your entire SQL database
#60This is just XSS mapped to LLMs. The problem, as is so often the case with admin apps (here "Cursor and the Supabase MCP" is an ad hoc admin app), is that they get a raw feed of untrusted user-generated content (they're internal scaffolding, after all). In the classic admin app XSS, you file a support ticket with HTML and injected Javascript attributes. None of it renders in the customer-facing views, but the admin v…
An XSS mitigation takes a blob of input and converts it into something that we can say with certainty will never execute. With prompt injection mitigation, there is no set of deterministic rules we can apply to a blob of input to make it "not LLM instructions". To this end, it is fundamentally unsafe to feed _any_ untrusted input into an LLM that has access to privileged information.