ProjectBuild an Agentic Content Studio: the explanation · Module 16: Security: sessions, uploads, SSRF and XSS · part 18 of 22
Part 18 · Module 16: Security: sessions, uploads, SSRF and XSS

Module 16: Security: sessions, uploads, SSRF and XSS

24 min read·
About 45 minutes · Needs: Module 6 (sign-in, the session cookie and the brand), Module 7 (the deck spec and escaping on render), Module 11 (Chromium and its request allow list) · Code: backend/app/main.py, backend/app/core/ratelimit.py, backend/app/api/routes/auth.py, backend/app/core/config.py, backend/app/services/files.py, backend/app/render/chromium.py, backend/app/schemas/deck.py, frontend/src/render/text.ts, frontend/nginx.conf.template, backend/tests/test_security.py

Where this fits

WHERE THIS FITS Slidesmith Studio this module BROWSER React FRONT DOOR AND API nginx, FastAPI BACKGROUND AGENTS LangGraph MODELS Ollama RENDERING Playwright DATA Postgres 17 OPERATIONS evals, Docker, Cloud Run Studio app React pages /render page same renderer nginx proxy, headers Auth sessions, CSRF Brand kit onboarding, uploads Projects deck spec, edits Job runner progress over SSE Research search, facts Strategist outline Designer slide JSON Check fit, else repair LangGraph pipeline state graph, JSON repair Ideas post ideas from pillars qwen3.8:27b Ollama, local GPU Web search Ollama API Chromium render, measure Exports PDF, PNG, ZIP, HTML PostgreSQL users, decks, jobs Uploads disk or GCS Evaluation suites, gate Insights usage, timings Containers Docker Compose Deploy Cloud Run, CI/CD
The parts this module hardens (blue): the front door and session, the brand kit and its uploads, the projects that hold deck text, and the server's own Chromium.

Every other module adds a feature. This one asks how each feature can be abused, and shows the code that stops it. The highlighted parts are where attacks land: the front door (nginx and the session), the brand kit with its uploads, the projects that hold deck text, and the server's own Chromium, which opens pages on the server's network.

The rest of this project is yours to keep

This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan