{"slug": "csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a", "title": "CSRF in AI-built apps: can another website make your logged-in users do things? (a 5-minute test)", "summary": "A developer published a five-minute manual test for cross-site request forgery (CSRF) in AI-built apps that authenticate users with cookies, warning that such apps often ship with no CSRF protection. The test checks for state-changing GET requests, missing SameSite settings, POST routes without CSRF tokens, and endpoints that accept form-encoded or text/plain bodies alongside JSON. The writeup notes that external scans can read cookie flags and headers on public pages but cannot log in, so they cannot prove a logged-in route is safe.", "body_md": "CSRF stands for cross-site request forgery. A visitor is logged in to your app. They open another website, and that site quietly makes their browser send a request to your app, such as \"change email\", \"delete project\" or \"transfer credits\". The browser attaches the visitor's cookie, so your app thinks the request is real. AI-built apps with cookie logins often have no protection against this.\n\nOnly apps that log users in with cookies. If your app sends a token in an `Authorization` header that your own frontend code adds, a foreign site cannot make the browser add it, so classic CSRF does not apply. Check which one you use before you spend time on this.\n\n`GET` requests (`/api/delete?id=5`)` SameSite` setting, or `SameSite=None`\n`POST` routes have no CSRF token`application/x-www-form-urlencoded` or `text/plain` bodies as well as JSON\nUse your own app and a test account only.\n\n`SameSite=Lax` or `Strict`, `HttpOnly` and `Secure`.` Origin` header on state-changing requests and reject unexpected origins.`X-Requested-With` or a JSON content type on API routes.\nAn outside scan can read your cookie flags and headers on public pages. It cannot log in, so it cannot prove a logged-in route is safe from CSRF. Run the test above on your most sensitive routes.\n\n**Check your own app from the outside, free.** [Run the free ProofForge scan](https://proofforge.live) on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: [see pricing](https://proofforge.live/pricing). Building with an AI agent? There is an [MCP server](https://proofforge.live/mcp-server) so it can check before it deploys.", "url": "https://wpnews.pro/news/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a", "canonical_source": "https://dev.to/proofforge_live/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a-5-minute-test-56dp", "published_at": "2026-11-29 01:05:30+00:00", "updated_at": "2026-11-29 01:14:05.827284+00:00", "lang": "en", "topics": ["ai-safety", "ai-agents", "developer-tools"], "entities": ["ProofForge"], "also_reported_by": [], "takeaway": "Cookie-authenticated apps need SameSite=Lax or Strict, Origin-header checks on state-changing requests, and CSRF tokens on POST routes, since outside scans cannot log in to prove a protected route is safe.", "recommendation": {"advice": "If your app logs users in with cookies, set SameSite=Lax or Strict and reject unexpected Origin headers on state-changing requests, then manually test your most sensitive routes with a test account.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a", "markdown": "https://wpnews.pro/news/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a.md", "text": "https://wpnews.pro/news/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a.txt", "jsonld": "https://wpnews.pro/news/csrf-in-ai-built-apps-can-another-website-make-your-logged-in-users-do-things-a.jsonld"}}