---
title: "Web Security Articles: XSS, CSP, Secrets and Auth"
description: "Web security for developers: why localStorage is unsafe for tokens, CSP headers, leaked secrets in Git, npm supply chain checks and the Next.js middleware CVE."
canonical: "https://www.trevorlasn.com/topics/security"
author: "Trevor I. Lasn"
last-updated: "2026-11-11"
---

# Web Security Articles: XSS, CSP, Secrets and Auth

Web security for developers: why localStorage is unsafe for tokens, CSP headers, leaked secrets in Git, npm supply chain checks and the Next.js middleware CVE.

14 current articles on Security, newest first. See [every topic](https://www.trevorlasn.com/topics.md).

## 2026

- [DeepSeek Harness Keeps Uploading Your Sessions After You Turn Telemetry Off](https://www.trevorlasn.com/blog/deepseek-harness-keeps-uploading-your-sessions-after-you-turn-telemetry-off.md): DeepSeek Harness sends your session log, plugin list and device id to DeepSeek by default. The documented opt-out stops one of four uploads. (2026-11-11)
- [How I Use Vercel BotID to Stop Bots on Auth Endpoints](https://www.trevorlasn.com/blog/vercel-botid-bot-protection-nextjs.md): BotID verifies browser challenges before proxying to the backend. Here's how I set it up in Next.js 16. (2026-02-16)

## 2025

- [NPQ: Audit npm Packages for Malware Before You Install](https://www.trevorlasn.com/blog/npq-protects-npm-installs-from-malicious-packages.md): A CLI tool that checks packages for security issues and social engineering attacks before they hit your project (2025-07-26)
- [CVE-2025-29927: The Next.js Middleware Bypass Explained](https://www.trevorlasn.com/blog/cve-2025-29927-nextjs-middleware.md): The vulnerability skips Next.js middleware security checks by adding a single HTTP header (2025-04-06)
- [is-my-node-vulnerable: Check Your Node.js Version for CVEs](https://www.trevorlasn.com/blog/is-my-node-vulnerable.md): This package compares your Node.js version against the Node.js Security Database, providing immediate feedback about potential security risks. (2025-01-29)

## 2024

- [Add Auth to Astro 5 with Clerk in 5 Minutes](https://www.trevorlasn.com/blog/astro-and-clerk.md): The simplest setup for adding Clerk authentication to your Astro project, with minimal code (2024-12-18)
- [HTTP CONNECT: Building Secure Tunnels Through Proxies](https://www.trevorlasn.com/blog/http-connect.md): HTTP CONNECT asks a proxy to open a TCP tunnel to a host, so HTTPS passes through still encrypted. How the method works, a Node.js client, and common pitfalls. (2024-11-28)
- [No, Quantum Computers Won't Break All Encryption](https://www.trevorlasn.com/blog/quantum-computers-wont-break-encryption.md): Symmetric encryption algorithms like Advanced Encryption Standard (AES) are largely quantum-resistant already (2024-10-31)
- [Why localStorage Is Unsafe for Tokens and Secrets](https://www.trevorlasn.com/blog/the-problem-with-local-storage.md): localStorage is vulnerable to XSS and has no expiry or encryption. Learn why httpOnly cookies and sessionStorage are safer for auth tokens. (2024-10-28)
- [Secretlint: Stop Committing API Keys and Passwords to Git](https://www.trevorlasn.com/blog/secret-lint.md): Secretlint scans your code for API keys, tokens and passwords before they reach Git. Install it, run it in a pre-commit hook with Husky, and pick its rules. (2024-10-22)
- [How to Add Content Security Policy (CSP) Headers to Astro](https://www.trevorlasn.com/blog/csp-headers-astro.md): Add a Content Security Policy to an Astro site to block XSS: Astro 6's built-in CSP, the Astro CSP gotcha, and header setups for Vercel and Cloudflare. (2024-10-16)
- [Cloudflare Study: 39% of Companies Losing Control of IT](https://www.trevorlasn.com/blog/39-percent-companies-losing-control-of-it-and-security.md): A Forrester study for Cloudflare found 39% of companies losing control of their IT and security, as remote work, cloud apps and new regulations pile up. (2024-10-03)
- [Gitleaks: Find and Prevent Credential Leaks in Git Repos](https://www.trevorlasn.com/blog/your-repo-is-a-leaky-ship-probably.md): Automate security flows and ensure your team follows security best practices (2024-08-06)
- [Frontend Security Checklist](https://www.trevorlasn.com/blog/frontend-security-checklist.md): A frontend security checklist covering XSS, Content Security Policy headers, CSRF, insecure direct object references and exposed environment variables. (2024-07-30)
