Hardening AI Agent Tool Access in GeoMart
说明与用途
在 GeoMart 中加强 AI 代理工具访问安全:修复漏洞、添加 Cloudflare Turnstile 并纠正数据库迁移。
问题
AI agents could submit quotes without human approval by exploiting insecure API endpoints and insufficient client‑side checks.
结果
After hardening, all automated bypass attempts failed; only genuine human interactions can submit quotes. The database now correctly records approved quotes.
工作流
- 1. Run Antigravity on the repo to identify vulnerabilities.
- 2. Escape all agent‑supplied strings before inserting into the DOM.
- 3. Add an isTrusted check to the submit button click handler.
- 4. Remove insecure Origin and session cookie checks.
- 5. Integrate Cloudflare Turnstile on the client and verify the token server‑side using a Worker secret.
- 6. Apply the missing database migration for quotes.
- 7. Retest with Antigravity, including a Node.js fetch that sets Origin to the site domain.
- 8. Verify that all bypass attempts now return 403 or 500 as appropriate.
证据
Antigravity's first pass found that agent-supplied text, the quote reasoning, the product IDs in the comparison tray, was going straight into the page via unescaped innerHTML.
I added Cloudflare Turnstile, verified server-side against a secret stored only in a Worker secret, never committed, never in the client bundle.
- 记录日期: 2026-09-06T00:08:01.526Z