We built an AI chatbot for websites called Botly Pro. In November, we ran our own security tool against it, and it found that anyone on the internet could read our customers' chatbot data straight from Firestore. Then, after we fixed that, it found that they still could.
Both issues are fixed. Here's what went wrong, because both mistakes are easy to make in any Firebase app.
The setup
The chatbot widget runs on our customers' sites. When a visitor opens a page, the widget loads that bot's published configuration straight from Firestore, using the project's public web config.
That's normal for Firebase, but it means the API key and project ID ship in every page. The security rules are the only thing between the internet and your data.
Each bot's document held its public settings and, in the same document, its knowledge base: the text from the customer's site that the AI answers from.…