SShortSingh.
Back to feed

Hardening Local Reverse Proxies for AI Agent Sidecars and MCP Tools

0
·3 views

Developers running MCP servers, local vector databases, and AI coding agents often expose many localhost services through reverse proxies such as Nginx, Caddy, or Traefik. A common docker-compose mistake maps ports to 0.0.0.0, which lets any device on the same local network reach internal agent tooling. Binding explicitly to 127.0.0.1 closes that exposure. The article also warns of DNS rebinding attacks, where a malicious site can use a rebound DNS record to make a browser send requests to local endpoints, and recommends strict Host header whitelisting as a defense. Blocking path traversal and access to sensitive dotfiles at the proxy layer is also advised.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

FSCSS 1.2.3 Adds Derived Arrays for Reusing Method Output as Collections

FSCSS array methods such as .reverse, .list, and .length return strings rather than array objects, and they cannot be chained. Version 1.2.3 introduces derived arrays, where a new @arr declaration takes a method's output and resolves it into a proper array that can be indexed, looped over, and derived from again. The approach is illustrated with examples such as reversing a color list, building 1-based index sequences sized to a source array, and appending items with the mutation operator. The guidance recommends declaring a new array step whenever a result needs to be reused, since chaining is unsupported. The author notes that derived arrays add no new runtime type but make method results dependable for practical module patterns.

0
ProgrammingDEV Community ·

Storing Money in Code: Integer Cents Versus Decimal Types

This lecture is aimed at developers who need to store prices, total carts, split bills, or convert currencies without losing a cent. It demonstrates that binary floating-point errors corrupt amounts: int(19.99 * 100) yields 1998 instead of 1999, and the same flaw appears in JavaScript and SQLite. The recommended approach is to store amounts as integer counts of each currency's minor unit, such as 1999 for 19.99 USD, which keeps arithmetic exact across languages and databases. Because minor-unit counts differ by currency (JPY and KRW have none, USD and EUR have two, BHD has three), the author found that locale formatters and runtime libraries disagree, so developers should maintain their own currency table. A small Python converter is provided that parses text with Decimal and rejects input with more decimal places than the currency allows.

0
ProgrammingDEV Community ·

AI-Suggested npm Package Didn't Exist, Exposing 'Slopsquatting' Risk

AI assistants sometimes recommend installable packages that do not exist, and attackers can exploit this by registering those names and publishing malicious code. This practice, called slopsquatting, was seen with a fabricated package named react-codeshift, which appeared in over 200 GitHub files after AI-generated instructions cited it. Security researcher Charlie Eriksen of Aikido registered the name first on January 14, 2026, as a harmless placeholder, though it still draws dozens of downloads weekly. The article demonstrates that npm lifecycle scripts like postinstall can execute automatically during installation, even without importing the package. It recommends checking a package's existence, age, and download count in the registry before installing anything an AI suggests.

0
ProgrammingDEV Community ·

Running Multiple AI Coding Agents on One Repo Using git worktree

Running several AI coding agents in a single repository can cause their uncommitted changes to mix, since they share one working directory. The article explains that git worktree, available since Git 2.5, creates separate folders and branches linked to the same repository so each agent can work in isolation. The author tested the approach with git 2.50 on a demo repo and the express repository, noting that a worktree takes far less disk space than a second clone. Limitations include a branch being checkoutable in only one worktree at a time, untracked files such as .env and node_modules not being copied, and merge conflicts still needing resolution. Commands such as git worktree add, list, remove and prune cover the basic workflow, and some AI tools like Claude Code can create worktrees automatically.