Arezgitfield notes / engineering
TOPIC COLLECTION20 GUIDES

Security

Practical security guides for your next development decision.

Security4 min read

Keep Untrusted Text and URLs in Separate DOM Boundaries

Separate DOM text insertion from URL authorization, test an HTTPS origin policy in Node.js, and trace denied updates without leaving a stale link active.

Read field note
Security5 min read

Design Archive Extraction Around Containment and Failure

Review archive extraction across path traversal, links, expansion limits, duplicate destinations, and publication so rejected input cannot become usable output.

Read field note
Security4 min read

Parse Explicit Records to Limit Prototype Pollution

Replace recursive JSON option merges with a bounded flat parser, reject unknown fields, and test that denied preferences cannot change shared object behavior.

Read field note
Security4 min read

Bound Validation Work Before Matching Untrusted Strings

Define an ASCII identifier grammar, reject oversized input before matching, and test failure boundaries without exposing a shared event loop to costly regexes.

Read field note
Security6 min read

Enforce Object Authorization Across Tenant Boundaries

Bind object lookups and mutations to authoritative tenant context, cover alternate access paths, and verify that denied requests leave no unauthorized effects.

Read field note
Security6 min read

Configure Credentialed CORS with Explicit Boundaries

Review allowed origins, credentialed response access, preflight behavior, and cache variation while keeping API authorization and CSRF controls authoritative.

Read field note
Security6 min read

Design Session Rotation and Revocation Together

Define browser-session authority, rotate identifiers at privilege changes, and test revocation across concurrent requests, caches, and delayed background work.

Read field note
Security7 min read

Constrain Subprocesses Against Command Injection

Choose fixed executables and validated operands, distinguish shell injection from argument injection, and bound subprocess authority, output, and failure behavior.

Read field note
Security5 min read

Design API Rate Limits Around Resource Budgets

Define API limits by trusted identity, operation cost, and concurrency, with shared enforcement, useful rejection responses, and tested failure behavior.

Read field note
Security5 min read

Verify Webhooks Before Accepting Durable Work

Authenticate webhook bytes before durable acceptance, separate delivery identity from business effects, and recover from duplicates and interrupted processing.

Read field note
Security5 min read

Prevent SSRF at the Outbound Request Boundary

Constrain user-controlled outbound requests with destination policy, connection-aware validation, network enforcement, bounded work, and recovery tests.

Read field note
Security5 min read

Validate File Uploads Before Making Them Available

Design upload quarantine, bounded content validation, controlled publication, and authorized downloads with explicit failure and cleanup behavior.

Read field note
Security5 min read

Roll Out Content Security Policy with Useful Evidence

Introduce Content Security Policy through resource inventory, scoped trust rules, report-only observation, browser verification, and bounded recovery.

Read field note
Security6 min read

Protect Cookie-Authenticated Actions Against CSRF

Protect cookie-authenticated mutations with request-intent validation, scoped cookies, authentication lifecycle handling, and browser-based failure tests.

Read field note
Security5 min read

Checksums, Signatures, and Provenance Solve Different Problems

A threat-based guide to release checksums, digital signatures, and build provenance, including trust distribution, verification policy, and residual risks.

Read field note
Security5 min read

Apply Least Privilege to CI Credentials

A threat-based CI credential design covering token scope, untrusted code, short-lived identity, protected environments, third-party actions, logs, and recovery.

Read field note
Security5 min read

Design Application Logs Without Leaking Sensitive Data

A secure logging workflow for selecting events, minimizing data, preventing injection, protecting transport and storage, controlling access, and testing failures.

Read field note
Security5 min read

Threat-Model a Small Feature Before It Ships

A lightweight threat-modeling method for mapping assets, actors, data flow, trust boundaries, abuse cases, controls, residual risk, and verification evidence.

Read field note
Security5 min read

Secret Scanning Before a Git Commit: A Practical Defense

How to prevent credentials from entering Git with staged-content scanning, entropy and format checks, allowlists, secure storage, and an incident response plan.

Read field note
Security6 min read

Secure Token Storage in React and Tauri Desktop Applications

A practical architecture for short-lived access tokens, rotating refresh tokens, OS credential vaults, IPC validation, logout, and unrestricted local work in Tauri.

Read field note