//nefariousplan

Name Is The Only Type

A field stored as a generic map (interface{}, JSON, dict) whose conventional name implies a constrained shape (an ID, a path, a number). The producer's contract is implicit in the name; once an API exposes write access, the consumer reads attacker input where it expected server output.

A field lives in a generic container. A Go map[string]interface{}, a parsed JSON blob, a Python dict, a PHP associative array, a Clojure open map, an Express IDataObject. The storage has no concept of what any key means. The code that produces each field honours a shape because the author chose a name that implied it. fileId holds a Mattermost ID. hashed_token holds a 64-character SHA-256 hex string. filepath points at a /tmp/<random> the multipart parser just wrote. role holds a WordPress capability slug. The producer and the consumer share the convention in a variable name, a parameter label, a docblock. Nothing in the container enforces it.

The class materialises when a new API, a parallel parser, or a mass-assignment loop exposes write access to the same named slot. The attacker becomes a second producer. The consumer reads the field by name, applies a .(string) cast or trusts the parameter's type annotation, and hands the value to the sink that corresponds to what the name said it was. The cast confirms the broad syntactic type. It does not confirm any part of the convention. The only code in the chain that ever treated the slot as a file ID, a hash, a temp path, or a role was the name the author typed above it.

Mechanism

Three parties participate in every exhibit. The container owns none of them.

The container is a generic associative structure whose element type sits at the top or bottom of the language's type lattice: map[string]interface{} in Go, Dict[str, Any] in Python, associative-array-of-mixed in PHP, open map in Clojure, IDataObject and Record<string, unknown> in TypeScript. The container's job is to store whatever its callers write. It has no schema. The developer who introduced the field did not install one because, at the moment the field entered the codebase, the only producer was the server itself.

The producer is server-side code that writes values into named slots. Mattermost's SaveFile emits a 27-character string into fields.fileId (CVE-2025-25279). n8n's Formidable integration writes filepath entries that point at the os.tmpdir() files it just created from the multipart stream (CVE-2026-21858). LiteLLM's auth success path hashes the raw bearer value and hands the result to get_key_object(hashed_token=...) (CVE-2026-42208). Grav's server-only config pipeline writes groups and access entries into the user YAML as nested permission trees (CVE-2026-42613). The producer honours the convention because the producer's author wrote both halves of the exchange when the field first existed, so the shape lived implicitly between two pieces of trusted code.

The consumer reads a named slot with security-relevant authority. Mattermost's duplicate endpoint pulls block.Fields["fileId"].(string) and hands the result to filepath.Join as a source path. n8n's prepareFormReturnItem iterates the files dict and hands each entry's filepath to copyBinaryFile as a read source. LiteLLM's get_data interpolates the hashed_token parameter straight into WHERE v.token = '{token}'. Grav's access-control subsystem reads groups and access out of the user dict as privilege decisions. The consumer's .(string) cast, isinstance branch, or TypeScript annotation confirms only that the value is of the broad container type. The convention that said this value is an ID, a temp path, a hash, a role, lived in the variable's label and nowhere else.

The class materialises when any API lets an attacker become the second producer. A block-write endpoint that accepts POSTed fields entries whole. A JSON body-parser routed to the same URL as the multipart parser, so express.json() writes an attacker-supplied object into req.body.files where Formidable used to write it. An exception handler that propagates the raw bearer header into the same key-lookup helper the success path hashes before calling. A WordPress mass-assignment loop over a developer-maintained list of field names that happens to include role, the one key wp_insert_user reads as capability. The consumer runs unchanged. The sink runs unchanged. The attacker's value crosses the trust boundary at the one line in the chain where the only thing between caller input and server authority was the variable's name.

The failure repeats across languages because every modern runtime ships a free-form container as its ergonomic default: dict, Map, Record, interface{}, open map, associative array. The container's affordances make the surrounding code easy to write and leave the shape contract scattered everywhere except the storage: in the schema the serialiser accepts, in the parameter name the consumer reads, in the comment above the function, in the reviewer's head. A patch that adds a predicate at one read site, Mattermost's ValidateFileId, LiteLLM's switch to a parameterised bind, n8n's a.ok(req.contentType === 'multipart/form-data'), closes the demonstrated chain. The container still has no schema. The next consumer that reads the same name under the same type assumption reopens the class for the same field, because the name is still the only thing the storage layer tells it.

The pattern lives next to several neighbours that describe different gaps in the same family. Convention Is The Allowlist is the sibling where a specification narrates a value set a field may carry and the parser installs none of it; the container may be fully typed, and the gap is in the value-range check. Name Is The Only Type is the specific case where the container itself is the gap: it carries no per-field type, so the field's name is the entirety of the contract. JavaScript-specific primitives like Object Literal As Map and pin-then-spread describe the container's own mechanics (inherited keys, source-order key resolution) carrying the exploit; here the container's mechanics are mundane and the only problem is that it stores anything.

Exhibits

CVE-2026-42613: Grav's Patch Is a Two-String Denylist. The Profile Handler Iterates the Same Allowlist.. CVE-2026-42613 is the YAML-key instance of the pattern. Grav's user object is a free-form dict; the access-control subsystem reads two specific keys (groups and access) and treats their values as authority, while every other key in the same dict is profile data. The registration handler iterates an admin-configured allowlist of name strings and copies each named field from the POST body into the user dict, with no per-name filter and no per-name type. The privilege namespace is exactly two words; the allowlist's namespace is unbounded; nothing in the framework prevented the two privilege words from being added to the unbounded allowlist. The patch is a literal ['groups', 'access'] denylist applied to one of two functions that perform the same iteration. The name access is the only thing typing the field as a permissions tree, and the only thing standing between the form's POST body and $user->save() was the choice of word.

CVE-2026-21858: n8n's req.body.files Was Formidable's Output. The JSON Parser Used the Same Name.. CVE-2026-21858 is the body-parser instance of the pattern. n8n's req.body.files is a Record<string, MultiPartFormData.File> whose conventional name implies "the multipart parser wrote it and filepath points at a temp file." The producer's contract is implicit in the name. Express dispatches body parsing on Content-Type, so an application/json request to the same route routes through express.json() and writes attacker-supplied JSON into req.body.files whole. The Form Trigger handler iterates files and calls copyBinaryFile(file.filepath, ...) against whatever string the attacker put in filepath. The patch is a.ok(req.contentType === 'multipart/form-data') added to the function body, the runtime predicate that finally types the field by what produced it rather than by what it was named.

CVE-2026-42208: hashed_token Was a Parameter Name. The Function Trusted the Name.. CVE-2026-42208 is the function-parameter instance of the pattern. get_key_object accepts a parameter named hashed_token and does no runtime check that the value it received is hashed. Two of three callers in the LiteLLM proxy honour the convention by hashing on the line above the call. The third caller, a logging callback hung off post_call_failure_hook, is reached via the auth handler's except branch and arrives carrying the raw header value the assertion gate had just rejected. The same function then computes a hashed_token local in scope and interpolates the raw {token} parameter into its SQL anyway. The name carried the contract; nothing else did.

CVE-2025-25279: Mattermost's fileId Was Never An ID. CVE-2025-25279 is the canonical instance: fields.fileId is a map[string]interface{} value whose name is the only thing connecting it to the file-ID type. The duplicate endpoint reads it as a path. The patch retroactively types the field by introducing ValidateFileId and applying it at every block-write call site. The bug class predates the duplicate endpoint; it's the gap any time a JSON field's name is a stronger contract than its storage.

Boundaries

Not every mass-assignment bug is this pattern. Mass assignment is the write-side primitive: an API lets a caller populate fields the caller should not have authority over. Name Is The Only Type is the consumer-side primitive: a named slot is read with authority the storage does not carry, regardless of which write path reached it. The two co-occur in several exhibits (Grav, Easy Elements, Super Forms) because the write-side primitive is what surfaces the named slot. A mass-assignment bug whose patch is purely "narrow the writable fields" without typing the consumer remains open: the next write path that reaches the same slot, from a different handler, through a different allowlist, inherits the untyped read.

Not every implicit-contract bug is this pattern. Convention Is The Allowlist is the sibling where a specification narrates a value set a field may carry and the parser installs none of it. The container may be fully typed in that shape; the gap is in the value-range check the spec's prose narrated. Name Is The Only Type is the specific case where the container itself is the gap: a generic map whose per-field type lives entirely in the name. If the parser already narrows the value's syntactic type and the problem is that the spec narrowed it further, the shape is Convention Is The Allowlist. If there is no per-field type for the parser to narrow because the container stores free-form values, the shape is Name Is The Only Type.

Not every JavaScript container-mechanics bug is this pattern. Object Literal As Map names the case where the default container's inherited keys leak the prototype chain through bracket lookup against attacker-controlled key names. Pin-then-spread names the specific object-literal semantics where a server-pinned authoritative field is overridden by attacker JSON because the spread resolves last. Name Is The Only Type is agnostic to the container's mechanics; the container merely stores what any producer wrote. If the exploit depends on JavaScript's own-vs-inherited-key semantics, the prototype-pollution class applies. If it depends on source-order key resolution between a pin and a spread, pin-then-spread applies. If the attacker's value is a plain own-key with attacker content that the consumer reads by name as a type, this pattern applies.

Not every parameter-name-trusted bug is this pattern. A parameter that is only ever called by trusted internal code, with the convention enforced at a boundary upstream, does not materialise the class even if the parameter's body does no runtime check. The pattern needs a reachable code path where the convention is broken: a second caller that skips the normalisation, a failure handler that forwards unprocessed inputs, a parallel parser mounted on the same route. LiteLLM's hashed_token qualifies because the exception branch reaches get_key_object with the raw header value the assertion rejected. A hashed_token parameter called exclusively by the auth success path, with no exception-handler branch and no second caller, carries the same shape and does not demonstrate the class until the second producer arrives.

Defender playbook

Enumerate every free-form container in the codebase where a consumer reads by named key with security-relevant authority. In Go: every map[string]interface{} with a .(T) type assertion at the read site. In Python: every Dict[str, Any] or **kwargs whose keys are referenced by literal string from a privileged sink. In PHP: every $_POST[...] or option-array iterator that walks a developer-maintained name list into a privileged assignment call. In TypeScript: every IDataObject or Record<string, unknown> cast whose downstream value is handed to a filesystem, SQL, or shell call. For each named slot, write down what the convention promised the value would be, what the storage actually accepts, and what the consumer does with the value. Every row where those three answers disagree is a candidate exhibit of this class.

Install the type contract at the consumer, not only at the writer. The producer already honours the convention; adding a schema check on one write path closes the demonstrated chain and leaves the next write path uncovered. Mattermost's patch installs ValidateFileId on every block write and again inside CopyCardFiles; the layering moves the invariant out of the variable's name and into the read. LiteLLM's patch did not add a hash check to get_key_object; it parameterised the SQL at the sink, so the attacker's unhashed bytes can no longer influence query structure. n8n's patch asserts req.contentType === 'multipart/form-data' at the top of each of the three handlers that read req.body.files. All three shapes are valid; what matters is that the check lives where the name is read as a type, not only where one producer happens to write it.

Test every consumer with attacker-shaped values in the named slot. A fileId entry that holds ../../../etc/passwd. A hashed_token parameter that holds ' OR 1=1--. A filepath entry that holds /etc/passwd. A role entry that holds administrator from an unauthenticated request. A :user-id keyword that holds a HoneySQL {:raw "..."} map. The regression test's name should be the sentence the convention encoded in the variable's label: a fileId must be a Mattermost ID, a hashed_token must be 64 hex characters, a filepath must resolve under os.tmpdir(). Each failing test is one assumption leaving the comment and entering the suite. Each passing test after the fix is one fewer line in the codebase where the storage carries less information than the reader.

Audit every new write path against the existing consumer list. The class remains open for the lifetime of the container's contract. When a new API lets a caller populate the container, authenticated or not, the question is not "does this API authenticate." The question is "which of the existing consumers reads the fields this API writes, and do any of those reads treat the field name as a type." A new mass-assignment loop over a developer-maintained list is a new producer. A new body-parser mounted on an existing route is a new producer. A new exception handler that propagates partially-processed inputs into a logger that reaches the key-lookup helper is a new producer. Each inherits the consumer's name-as-type assumption, and the audit question is whether the convention still holds now that the producer set has grown.

Kinship

Convention Is The Allowlist. Sibling in the general class of implicit-contract-never-compiled-into-a-check. Convention Is The Allowlist is the broader shape: a specification narrates a value set a field may carry, and the parser installs the broad syntactic type instead of the narrower set. The container may be fully typed. Name Is The Only Type is the specific case where the container itself is the gap: a generic map whose per-field type lives in the name. The two often appear on the same codebase at different layers, with the spec narrowing the values a field may carry and the container discarding even that much structure at storage.

Internal Only By Convention. Sibling at the trust-source layer. Internal Only By Convention names the case where a channel (a header, a parameter, an environment input) is documented as internal-only and the runtime reads it from any inbound request anyway: the implicit contract is about who may write the channel. Name Is The Only Type names the case where a named slot's shape is promised by its label and the storage enforces no part of it: the implicit contract is about what the value may be. Both patterns describe conventions that live in documentation rather than in code; the two often coexist on the same input, one covering the writer and one covering the value.

Object Literal As Map. Adjacent JavaScript-specific class. Object Literal As Map describes the default {} container's inherited keys: twelve names from Object.prototype resolve to non-undefined values through bracket lookup, so a consumer that reads attacker-controlled keys from the container leaks the prototype chain without any writer ever writing into it. Name Is The Only Type has a different container problem: the container stores what was written, but the consumer reads a specific name as a type the storage does not carry. If the exploit depends on inherited keys, Object Literal As Map names the primitive; if the exploit depends on an own-key with attacker content that the consumer reads by name, this pattern applies.

Design Debt Driver. Meta-relationship. Name Is The Only Type is a Design Debt Driver whenever the container, not any one handler, is the primitive. Each patch closes the consumer that ships the demonstrated chain; the container's missing per-field type keeps the class open for the next consumer that reads the same name under the same assumption. n8n's CVE-2026-21858 lands three identical a.ok(req.contentType === 'multipart/form-data') asserts across three handlers in the same commit precisely because the previous instance of this class in the same codebase had taught the maintainers that the gap repeats per read site.

The container stores what any writer gives it. The name was a note to the next reader.