codewithkarani
All topics

Category

Security

Every guide on Security from Code With Karani - 62 field-tested articles on Security for developers and teams.

62 articles

December 2026

  1. Drupal installer flaw exploited: update core and lock down install.php

    Drupal says a second installer bug, CVE-2026-136716, is being exploited to take over sites. Update to 11.4.14, 11.3.23 or 10.6.23, run update.php and block install.php.

    5 min read

  2. Denial of wallet: how a public AI chatbot can run up your API bill, and the limits that stop it

    A public chatbot bills you for every token, so anyone who can send it messages can spend your money. What OWASP LLM10:2025 says, how to price one abusive request, and the server-side limits to put in front of the model.

    6 min read

  3. Deepfake voice and video fraud: payment controls that stop a cloned voice

    A cloned voice or a fake video call can sound exactly like your boss. These process controls, from call-backs on known numbers to two-person approval in ERPNext, stop it from moving money.

    6 min read

  4. Giving an AI agent tools safely: MCP server security, tool poisoning and least privilege

    What the Model Context Protocol specification says about trusting tool servers, how tool poisoning works, and the least-privilege habits that keep an MCP setup safe.

    6 min read

  5. Slopsquatting: when your AI coding assistant invents a package

    AI coding tools sometimes recommend packages that do not exist, and attackers can register those names. What the USENIX Security 2025 study measured, and four checks that keep a hallucinated package out of your project.

    6 min read

July 2026

  1. Exactly-once over an unreliable pipe: HMAC, nonces, and a byte-exact contract

    A per-request nonce and a per-content hash look like the same idea and are not. One says this request arrived twice, the other says this message arrived twice, and a payment pipeline needs both. The signing design behind a production SMS gateway.

    12 min read

  2. Deploying Frappe apps to a client server you're not allowed to touch

    The client will not give you access to their dev server, so every code change means someone on their side pulls and migrates by hand. Here is the complete fix: a self-hosted runner they install, a deploy script they own, and no credential to their environment on your side at all.

    13 min read

  3. Bolting a phone onto ERPNext: custom routes, guest endpoints and HMAC auth in Frappe

    Frappe claims every /api/* path before website routing, so a fixed third-party path 404s. Here is the before_request rewrite that fixes it, including the cached property you also have to bust, and why allow_guest endpoints can still be strongly authenticated.

    12 min read

  4. Push access is code execution: hardening a self-hosted runner

    A self-hosted runner executes whatever the workflow file says, and the workflow file lives in a repository you control. So push access to your repository is command execution on your client's server. Here is the honest risk and the layers that contain it.

    7 min read

  5. Secrets, environments and required reviewers

    A repository secret is readable by everyone who can push to the repository. An environment secret is not released until a gate opens. Understanding that difference is what lets you hand the client the key to their own deployments.

    8 min read

  6. Access is a liability, not a convenience

    Every SSH key you hold on a client's server is a credential you now have to defend, insure and explain. The strongest position in an enterprise procurement conversation is not having it at all.

    8 min read

  7. Blocked by CORS Policy: Stop Reaching for Access-Control-Allow-Origin: *

    The wildcard breaks the moment you send cookies, and reflecting the Origin header is worse. Here is the allowlist pattern, the nginx config and the curl test that proves it.

    9 min read

  8. Free HTTPS on Nginx With Let's Encrypt, and the Renewal Everyone Forgets

    Getting a free Let's Encrypt certificate on Nginx takes five minutes. Keeping it alive for the next three years is the part that breaks. Here is the issue, the config and the renewal.

    6 min read

  9. Your Cert Automation Should Default to Let's Encrypt Staging

    Five test renewals can exhaust the duplicate certificate limit and block a real renewal for a week. Here is why certbot drifts to production, and the directory split that prevents it.

    8 min read

  10. Certbot connection refused on http-01: diagnosing proxies, IPv6 and port 80

    Connection refused is not the same as a timeout, and the difference tells you exactly where to look. A diagnostic order for failed Let's Encrypt http-01 challenges.

    10 min read

  11. The agent drafts, the human commits: designing the write path for a business AI

    A wrong read costs minutes. A wrong write costs a reconciliation. So the commit lives behind an HTTP endpoint the agent cannot call - and everything it can do is scoped to the requesting user, written to an audit row in the same transaction, and given a tested reversal.

    6 min read

  12. The Security Checklist Every Kenyan SME Running Its Own Server Should Finish This Week

    You do not have a security budget problem, you have a completeness problem. Ten free controls with real commands, a cost table, and the weekly rhythm that keeps a self-hosted Kenyan SME system out of trouble.

    7 min read

  13. Kenya's Data Protection Act Is an Engineering Spec: What Sections 25, 31, 41 and 43 Demand From Your Code

    The DPA 2019 is not a lawyer problem, it is a schema, retention and logging problem. Registration thresholds, the 72-hour breach clock, the encryption safe harbour, and the eight things to build this quarter.

    9 min read

  14. How Kenyan Small Businesses Actually Get Hacked (Nobody Is Burning a Zero-Day on Your Duka)

    Five real attack chains account for almost every SME breach: infostealers, credential stuffing, exposed admin panels, unpatched plugins and invoice fraud. With the log commands to check each one today.

    8 min read

June 2026

  1. Stop Committing Keys: A Secrets Workflow for Two-Person Teams Using SOPS and age

    You do not need Vault. You need encrypted secrets in git, one age key per human, and a pre-commit hook that refuses the mistake. Full setup, offboarding in two commands, and when to actually upgrade.

    7 min read

  2. Certbot http-01 Fails Behind Your Force-HTTPS Redirect: It Is Not HSTS

    Let's Encrypt follows your 301 to HTTPS and ignores HSTS entirely. So the real cause of a failed http-01 renewal is one of four things, and disabling HSTS is not the fix.

    9 min read

  3. Certbot renewal fails silently: alerting before the certificate expires

    Certbot can fail twice a day for three months without telling anyone, and Let's Encrypt stopped sending expiry emails in 2025. Three independent alerts that catch it, with the tests.

    8 min read

  4. CSP 'unsafe-inline' Is Not a Fix: Nonces That Work in Next.js

    Adding 'unsafe-inline' to silence CSP violations turns the header into compliance theatre. Here is the per-request nonce setup for Next.js that keeps hydration working.

    9 min read

  5. Surviving a Bot Flood on a $20 VPS: nginx limit_req, fail2ban and Cloudflare Free in the Right Order

    Diagnose before you block. A cost-ordered defence for small servers: Cloudflare's single free rate limit rule, nginx limit_req zones that do not break real browsers, fail2ban jails, and stale-while-updating caching.

    8 min read