Skip to main content

Portfolio App Threat Model v2 — Deployment & Runtime Security

Executive Summary

Stage 4.4 extends the Portfolio App threat model to include deployment surface and runtime misconfiguration risks. Focus areas: configuration drift, dependency compromise, CSP bypass attempts, performance abuse, and secret exposure in logs. Residual risks (Vercel infrastructure, CDN/npm supply chain, browser 0-days) are documented and tracked in the risk register. Mitigations center on environment validation, dependency audit policy, OWASP security headers with CSP, and structured logging.

STRIDE Analysis for Deployment Surface

CategoryThreatAssetImpactLikelihoodMitigation
SpoofingUnauthorized deploymentDeployment pipelineMalicious code in productionLowBranch protection, required reviews, immutable deploys, Vercel audit logs
TamperingBuild artifact modificationBuild output, npm packagesCompromised bundle served to usersLowSigned commits optional, frozen lockfile installs, Dependabot review, immutable Vercel deploys
RepudiationDenied deployment actionDeployment logsNo audit trail for changesLowGitHub Actions logs retained, Vercel deployment history
Information DisclosureSecrets exposed in deployment logsLogs, environmentCredential compromiseMediumNo secrets in env vars, log scrubbing, TruffleHog scanning, .env.example contract
Denial of ServiceBroken deployment or config errorInfrastructureService downtime until rollbackMediumStaging validation, health checks, rollback runbook
Elevation of PrivilegeMisuse of deployment permissionsGitHub/Vercel credentialsUnauthorized production accessLowLeast-privilege IAM, branch protection, review before merge

Runtime Threat Analysis

Threat CategoryThreatAssetAttackImpactMitigation
Config DriftEnv var misconfigurationEnvironment contractWrong URLs/config deployedMajorEnv validation, promotion gates, .env.example guidance
Dependency VulnMalicious/vulnerable dependencyBuild/runtimeRCE at build or runtimeCriticalDependabot, lockfile integrity, audit policy, new dependency runbook
Framework RCEDeserialization exploit (R2S)Runtime surfaceRemote code executionCriticalPatch SLA, CSP nonce, strict input validation, CSRF, rate limiting
CSP ViolationInline script/style bypassBrowser securityXSS payload executesHighCSP with default-src 'self', limited script/style directives, monitor violations
Performance AbuseDDoS or resource exhaustionServer resourcesDegraded UX/outageMediumCDN shielding (Vercel), rate limiting future, health checks
Secrets in LogsSensitive data loggedLogsCredential/key compromiseCriticalStructured logging, log scrubbing, secret scanning, no secrets in env vars
Unhandled ErrorCrash with stack traceError responsesInfo leak + downtimeMediumError boundaries, not-found and error routes, monitoring

Residual Risks (Accepted)

  • Vercel infrastructure compromise: accepted; mitigated by vendor controls and immutable deploys
  • CDN/npm supply chain attack: accepted; mitigated by lockfile integrity, audit policy, and review
  • Browser 0-day enabling XSS: accepted; mitigated by CSP and framework updates
  • Insider threat (malicious dev): accepted; mitigated by review, audit logs, least privilege

Mitigation Summary

Threat CategoryMitigations
SecretsTruffleHog scanning, structured logging, environment contract (no secrets), .env discipline
DependenciesDependabot updates, frozen lockfile installs, audit policy and runbook, CodeQL
ConfigEnvironment validation, promotion gates, Stage 4.4 security headers/CSP
DeploymentBranch protection, required checks, immutable deploys, staging validation
RuntimeCSP nonce, OWASP headers, strict validation, CSRF, rate limiting, health checks
XSSCSP, framework security defaults, no dangerous user input, monitoring

References and Validation