How to check if your vibe-coded app is secure: 8 checks by hand

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

How to check if your vibe-coded app is secure: 8 checks by hand

测试正在运行的应用程序,而不仅仅是代码。在注销状态下打开它并读取其数据请求的返回结果,使用两个测试账户查看一个账户是否可以访问另一个账户的记录,并搜索浏览器下载的内容以查找密钥。以下八项检查需要使用浏览器的开发者工具和两个测试账户,且无需阅读代码。Saqr (usesaqr.com) 是一款 AI 安全测试服务,适用于使用 Lovable、Bolt、Replit、v0 和 Cursor 等 AI 编码工具构建的应用程序。每月 19 美元起,可随时取消。仅测试您已证明归您所有的应用程序。最初发布于 usesaqr.com。最后检查日期:2026 年 11 月 24 日。

Why is a code review not enough? AI coding tools and their built-in scans read code and settings, and they are worth running every time. Your users meet the deployed app: the scripts it sends to the browser, the data its API returns and the rules on its database. A rule can be valid and still too broad, and a key can pass a review and still ship to every visitor. A dated snapshot shows why the live app is worth testing: in October 2025, Escape reported analysing over 5,600 publicly available apps built on vibe coding platforms and finding more than 2,000 vulnerabilities and over 400 exposed secrets (Escape; Escape sells security testing). It says nothing about any particular app.

为什么代码审查不够?AI 编码工具及其内置扫描功能会读取代码和设置,每次运行它们都是值得的。您的用户面对的是已部署的应用程序:它发送给浏览器的脚本、其 API 返回的数据以及数据库上的规则。一条规则可能是有效的,但范围仍然太广;一个密钥可能通过了审查,但仍然被发送给每一位访问者。一份过时的快照展示了为什么实时应用程序值得测试:2025 年 10 月,Escape 报告称分析了超过 5,600 个在“氛围编码”(vibe coding)平台上构建的公开应用程序,发现了 2,000 多个漏洞和 400 多个暴露的密钥(Escape;Escape 出售安全测试服务)。这并不针对任何特定的应用程序。

What do I need before I start? Two test accounts in your own app, each with a little data of its own: a profile, an order, a file. A private browser window, so you start signed out. The developer tools: the Network tab to read requests and responses, and Search to look through every loaded script (Chrome DevTools). Do these checks only on an app you own or have written permission to test, with test accounts you created. Where a check changes data, use a staging copy if you have one.

开始之前我需要什么?在您自己的应用程序中准备两个测试账户,每个账户包含少量数据:个人资料、订单、文件。一个隐私浏览器窗口,以便您从注销状态开始。开发者工具:用于读取请求和响应的“网络”(Network)选项卡,以及用于查看每个已加载脚本的“搜索”(Search)功能(Chrome DevTools)。请仅在您拥有或获得书面测试许可的应用程序上进行这些检查,并使用您创建的测试账户。如果某项检查会更改数据,请使用暂存副本(如果有)。

Which checks should I do by hand? Eight checks, roughly in order of how much they matter. Each links to a free prompt for your AI coding tool if the check fails. 1. Read what the app returns while signed out In a private window, open the app and the Network tab, and filter to Fetch/XHR. Click through the public pages and open each response. Only data meant for everyone should come back. Email addresses, orders, messages or other people’s profiles in a signed-out response mean that data is reachable without signing in. If it fails: Require sign-in on every API route by default.

我应该手动进行哪些检查?八项检查,大致按重要性排序。如果检查失败,每一项都链接到一个供 AI 编码工具使用的免费提示词。1. 读取注销状态下应用程序返回的内容。在隐私窗口中,打开应用程序和“网络”选项卡,并过滤到 Fetch/XHR。点击浏览公共页面并打开每个响应。只有面向所有人的数据才应返回。如果在注销状态下的响应中包含电子邮件地址、订单、消息或其他人的个人资料,则意味着无需登录即可访问这些数据。如果失败:默认要求在每个 API 路由上进行登录。

  1. Try to open another account’s records Sign in as the first test account and open something that belongs to it. Note the id in the address or in the request. Sign in as the second account and ask for the same id. A safe answer is 401, 403 or “not found”. If the first account’s data comes back, the app checks that you are signed in but not that the record is yours. OWASP lists broken access control first in its Top 10 for 2025, and its cheat sheet explains the fix. If it fails: Stop one user reading another user’s records by changing an id.

  2. 尝试打开另一个账户的记录。以第一个测试账户登录并打开属于它的内容。记下地址或请求中的 ID。以第二个账户登录并请求相同的 ID。安全的响应应该是 401、403 或“未找到”。如果返回了第一个账户的数据,说明应用程序检查了您是否已登录,但没有检查该记录是否属于您。OWASP 将失效的访问控制列为 2025 年十大安全风险之首,其备忘单解释了修复方法。如果失败:通过更改 ID 来阻止一个用户读取另一个用户的记录。

  3. Search the browser’s scripts for secret keys Use Search in the developer tools to look through every loaded script for secret, sk_, service_role, sb_secret_ and the names of the paid services you use. Variables that start with VITE_ (Vite) or NEXT_PUBLIC_ (Next.js) are sent to every visitor. Keys documented as public, such as a Supabase publishable key or a Firebase API key, are fine there. A secret key is not: rotate it first, then move the call to the server. If it fails: Move secret keys out of the browser bundle.

  4. 在浏览器脚本中搜索密钥。使用开发者工具中的“搜索”功能,查看每个已加载的脚本,查找 secret、sk_、service_role、sb_secret_ 以及您使用的付费服务名称。以 VITE_ (Vite) 或 NEXT_PUBLIC_ (Next.js) 开头的变量会被发送给每一位访问者。文档中注明为公共的密钥(例如 Supabase 可发布密钥或 Firebase API 密钥)放在那里是可以的。但密钥则不行:请先轮换密钥,然后将调用移至服务器端。如果失败:将密钥移出浏览器包。

  5. Ask for files that should not be public Open /.env and /.git/config on your domain. A safe answer is “not found” or your app’s normal page. Then check whether the scripts have source maps next to them (the same address ending in .map): a source map lets anyone rebuild the original code (MDN). That is not always a problem, but it should be a choice.

  6. 请求不应公开的文件。在您的域名上打开 /.env 和 /.git/config。安全的响应是“未找到”或您应用程序的正常页面。然后检查脚本旁边是否有源映射(以 .map 结尾的相同地址):源映射允许任何人重建原始代码 (MDN)。这并不总是一个问题,但这应该是一个可选项。

  7. Visit admin and internal pages directly Type the addresses of pages that are not linked for everyone, such as /admin or a settings page, first signed out and then as an ordinary test account. Hiding a link is not protection. The page, and the data requests behind it, should refuse anyone who is not allowed. If it fails: Require sign-in on every API route by default.

  8. 直接访问管理页面和内部页面。输入未向所有人链接的页面地址(例如 /admin 或设置页面),先在注销状态下访问,然后以普通测试账户身份访问。隐藏链接并不是保护措施。页面及其背后的数据请求应拒绝任何未获授权的人员。如果失败:默认要求在每个 API 路由上进行登录。

  9. Try the limits on sign-in and password reset On one of your test accounts, enter a wrong password about ten times, then ask for a password reset several times in a row. A wait, a lock or a challenge should appear. Without one, passwords can be guessed and inboxes flooded. If it fails: Add a rate limit to sign-in and password reset.

  10. 测试登录和密码重置的限制。在您的一个测试账户上,连续输入错误密码约十次,然后连续多次请求密码重置。应该出现等待、锁定或验证挑战。如果没有这些措施,密码可能会被猜出,收件箱也可能被垃圾邮件淹没。如果失败:为登录和密码重置添加速率限制。

  11. Check what uploads accept and who can open them If the app takes uploads, try a file type it should refuse, such as an .html or .svg file, and see whether it is accepted and opens as a page on your domain. Then copy the address of a private upload, sign out and open it. If it fails: Lock down open storage buckets.

  12. 检查上传内容的接受范围及访问权限。如果应用程序支持上传,请尝试上传它应该拒绝的文件类型(例如 .html 或 .svg 文件),查看它是否被接受并作为您域名上的页面打开。然后复制一个私有上传文件的地址,注销并尝试打开它。如果失败:锁定开放的存储桶。

  13. Read the response headers and an error page In the Network tab, select the page itself and read its response headers. A content security policy, Strict-Transport-Security, X-Content-Type-Options and protection against framing limit the damage of other mistakes (OWASP cheat sheet). Then open an address that does not exist and confirm that no stack trace or file path appears. If it fails: Add the standard security headers.

  14. 读取响应头和错误页面。在“网络”选项卡中,选择页面本身并读取其响应头。内容安全策略 (CSP)、Strict-Transport-Security、X-Content-Type-Options 以及防框架攻击保护可以限制其他错误造成的损害 (OWASP 备忘单)。然后打开一个不存在的地址,确认没有堆栈跟踪或文件路径显示。如果失败:添加标准安全响应头。

What should I do with what I find? Start with anything that lets one person read or change another person’s data, and with secret keys in the browser. For a key, rotate it in the provider’s dashboard before anything else, because the old one must be treated as known. Then describe each problem precisely to the AI coding tool that built the app: what is wrong, where, the behaviour you want instead, and how you will check it. The fix prompts are written in that shape. Verify the fix on the running app by repeating the check, not by asking the tool whether it worked, and repeat the checks after each release that changes data, sign-in or uploads. For platform-specific steps, see the guides for Lovable, Bolt, Supabase and Fire.

我发现问题后该怎么办?首先处理任何允许一个人读取或更改另一个人数据的问题,以及浏览器中的密钥问题。对于密钥,请首先在提供商的仪表板中将其轮换,因为旧密钥必须被视为已泄露。然后向构建该应用程序的 AI 编码工具精确描述每个问题:哪里出了问题、是什么问题、您希望的替代行为是什么,以及您将如何检查它。修复提示词就是按这种格式编写的。通过重复检查来验证运行中的应用程序是否已修复,而不是询问工具它是否有效;在每次更改数据、登录或上传的发布后,都要重复这些检查。有关特定平台的步骤,请参阅 Lovable、Bolt、Supabase 和 Fire 的指南。