You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: Shriprasad-P/CodeForge-AI
Security
docs/security.md
Security Threat Model (MVP)
Assets
User passwords / password hashes
Auth session tokens (cookie)
GitHub App private key (Phase 3+)
LLM API keys (Phase 5+)
Database credentials
Short-lived GitHub installation tokens
User repository source code in sandboxes
Trust zones
Control plane (API, agent, worker) — holds secrets; never mounts Docker socket into sandboxes.
Sandbox — untrusted code execution; receives only a short-lived clone/push token.
Browser — untrusted; HttpOnly session cookie only (no tokens in localStorage).
Phase 2 auth mitigations
Threat
Mitigation
Password theft at rest
Argon2id hashes only; never returned by API
Session theft from DB
Store SHA-256(token), not raw cookie value
XSS token exfil
HttpOnly cookie; no localStorage auth
CSRF
SameSite=Lax + CORS allowlist; Secure cookies in non-dev
Immutable full artifact plus deterministic manifest, SHA-256 hash/version, approval binding, and exact recapture comparison before apply/commit
Sandbox-to-worker Git execution
Export excludes .git; capture overlays data onto a worker-owned checkout, isolates Git config/attributes, disables replace refs and external diff hooks, and force-adds ignored files
Stale repository base
Exact recorded HEAD required; no automatic rebase
Duplicate commit/PR
Deterministic branch; durable commit/PR state; existing PR lookup on retry
Credential exposure
Short-lived installation token stays in trusted worker; remote URL sanitized; never copied to sandbox
Default-branch mutation
Publication always creates a run branch and pushes branch:branch
Publication command injection
Git operations use fixed argv; branch/title are normalized and bounded
The developer GitHub App Manifest bootstrap is CLI-only, guarded to
development/local/test environments, uses a one-time random state, exchanges
the temporary code once, and stores the returned PEM in an ignored 0600 file.
It is not an API credential-generation route and is never part of production
runtime behavior.
Broader threats
Threat
Mitigation
Sandbox escapes to host
Non-root, no privileged, no Docker socket, resource limits (Phase 4)
Secret exfiltration via agent tools
Secrets never injected into sandbox env except short-lived GitHub token