Bearly Secure is the intentionally vulnerable starter app for Learn Web Security in Go. It's a tiny plushie shop built with Go, net/http, and SQLite.
Important
This README describes the freshly cloned starter project from lesson 1.2. Course assignments will change the app's behavior, but this file remains a reference for the initial baseline.
- Go 1.27.0 or newer
Seed the local database:
go run ./cmd/seedStart the app at http://localhost:3030:
go run ./cmd/serverIn another terminal, start the browser-based attacker lab at http://localhost:4040:
go run ./cmd/attackerlabIt runs as a separate process and stays on a separate origin so you can explore cross-origin browser security behavior.
Run the test suite:
go test ./...Check static analysis:
go vet ./...You can restore the deterministic starter data at any time with go run ./cmd/seed.
- Public storefront with product listing, search, detail pages, and reviews
- Account creation, login, logout, password reset, and session cookies
- Account profiles, order history, review management, and tax-document uploads
- Authenticated shopping cart and checkout with simulated PawPal and Acorn integrations
- Support and admin areas for order, tax-document, and product workflows
- JSON product and order APIs
- Browser attacker lab and embedded shipping widget
- Deterministic local order-assistant simulation
- SQLite seed data, local file storage, and JSON-lines application logs
- Single-stage container build that runs the Go source directly
Bearly Secure is deliberately unsafe. It contains exploitable authentication, authorization, injection, browser-security, data-exposure, infrastructure, and operational weaknesses for course exercises.
Do not deploy it or use its security patterns in a real application. Its credentials, integrations, payments, and third-party services are local simulations that use fake data only.
cmd/server: starts Bearly Securecmd/attackerlab: starts the attacker labcmd/seed: resets the deterministic SQLite datainternal/: contains application behaviorinternal/database/: contains migrations, sqlc queries, and seed datainternal/httpserver/: composes the HTTP server and middlewareinternal/auth/: contains authentication, session, TOTP, passkey, and access-control helpersinternal/integrations/: contains simulated external-service integrationsinternal/uploads/: contains upload metadata, middleware, and archive extractionweb/: contains server-rendered templates and static assetsattacker-lab/: contains the browser attacker lab assetsdata/uploads/: contains local uploads and the seeded sample tax exemption PDFdata/bulk-tax-documents/: receives documents extracted from support ZIP importsDockerfile: defines the initial single-stage container image