APIs, Backend & Security
API design, backend reliability and web security: rate limiting, idempotency, webhooks and Content Security Policy.
Cursor Pagination vs Offset Pagination: How to Page Through an API Properly
When to use cursor pagination or offset pagination in an API: why large offsets get slow, why pages repeat or skip items, keyset queries in SQL, opaque cursors, a Next.js route handler, response shapes, going backwards, and the mistakes I see most.
API Error Responses: How to Use Problem Details (RFC 9457)
How I design API error responses with Problem Details from RFC 9457: the application/problem+json format, what type, title, status, detail and instance mean, which status codes to use, validation errors with JSON Pointers, an Express error middleware, a fetch helper and what never to leak.
HSTS Explained: How Strict-Transport-Security Closes the HTTPS Downgrade Gap
A 301 redirect to HTTPS still lets the first plain HTTP request out. Here’s how HSTS closes that gap: the Strict-Transport-Security header and its directives, a safe max-age ramp, what breaks, the preload list and its requirements, setup in Nginx, Apache, Next.js, Vercel, Cloudflare and WordPress hosts, checking it with curl, and clearing it in Chrome.
Onamae.com Desktop Cloud Breach: 26,739 Servers and Stolen Trading Logins
On October 21, 2026, GMO Internet, the Japanese company behind the Onamae.com brand, said someone had planted malicious programs on customer servers in its “Onamae.com Desktop Cloud” service. A day later it confirmed customers were seeing unauthorized activity on their trading accounts. GMO shut down every server on every plan. Here’s what’s confirmed, what isn’t, […]
Railway Security Incident (October 2026): What Happened to Your Env Vars
Between October 20 and 22, 2026, attackers broke into internal systems at Railway, the app hosting platform, and pulled customer environment variables. Some of those secrets were decrypted. Railway says the attacker was hunting for AI provider API keys. If you deploy on Railway, or on any platform that stores your secrets for you, this […]
PHP2Shell (CVE-2026-109618 and CVE-2026-109619): What It Is and How to Fix It
On October 21, 2026, the PHP project shipped emergency releases for two critical bugs that can let an attacker run code on your server without logging in. People are calling the pair “PHP2Shell.” If you run WordPress, Laravel, a custom PHP app, or anything on shared hosting, this one’s about you. Here’s what broke, who’s […]
CORS Errors Explained: Fix Preflight, Credentials, and Allowed Origins the Right Way
How I fix CORS errors: preflight OPTIONS, credentials vs the * wildcard, Vary: Origin, nginx always, and safe Express, Next.js and WordPress setups.
API Rate Limiting Done Right: Protect Your Backend Without Locking Out Real Users
Practical rate limiting for Node.js, Next.js route handlers and WordPress REST: token bucket vs sliding window, Redis keys, Retry-After headers, per-user vs per-IP rules, and how to avoid blocking real clients while stopping abuse.
How to Verify Webhook Signatures (HMAC) the Right Way in Node.js, Next.js and WordPress
Your webhook URL is public, so anyone can post fake events to it. Here is how I verify HMAC webhook signatures with the raw body, constant-time comparison and timestamp checks, with working Express, Next.js and WordPress code.
Idempotency Keys in 2026: Stop Duplicate Payments and Double Submits in Your API
Learn how idempotency keys stop duplicate payments and double submits: the Idempotency-Key header, Postgres and Redis storage, 409 and 422 handling, safe retries, and webhook dedupe.
Content Security Policy in 2026: Lock Down XSS Without Breaking Your Scripts
Practical CSP in 2026: report-only rollout, nonces vs hashes vs strict-dynamic, WordPress and Next.js headers, GTM, and a checklist to stop XSS without breaking scripts.