The pattern has four parts. A library whose feature surface includes a security-relevant knob. A default for that knob that is the dangerous value. A consumer whose call reaches a sink that interprets the library's output as code. A caller-side omission that leaves the knob at its default.
The library carries both options because the library's feature set is wider than any one consumer's deployment. A Markdown renderer must emit HTML for consumers that embed Markdown inside pages they trust the author of and must refuse HTML for consumers that render community-submitted comments. A JSON or XML deserializer must reconstruct classes for callers that trust the input and must refuse construction for callers that do not. A script engine must give scripts host access for operators that need extension points and must sandbox scripts for operators that do not. Shipping both modes is not the mistake. Shipping the dangerous mode as the one the consumer gets by not asking is the mechanism this class names.
The library documents the safe option. EspoCRM's Michelf exhibit names no_markup and no_entities as public properties of the parser. vm2's Buffer.alloc exhibit names bufferAllocLimit in the changelog of the release that introduced it, with the value Infinity. SAP's Visual Composer has had a Setting Secure Mode help page on the vendor's own documentation site for twenty years while shipping SecurityMode = false. Yamcs's Nashorn has had NashornScriptEngineFactory.getScriptEngine(ClassFilter) since JDK 8 in March 2014. GD's Perl exhibit names the three-argument form of open() that Perl 5.6.0 introduced on March 22, 2000. Documentation does not change the default. The default is what the consumer gets by not asking.
The consumer calls the library. The call site reads for naturalness in the consumer's own language. defaultTransform. new VM(). open(my $fh, $path). unserialize($data). AutoTokenizer.from_pretrained. factory.getScriptEngine(). from jinja2 import Environment. Action::make()->action(...). register_post_type('wpcode', array('public' => false)). allowTypes(whitelist). None of those call sites pass the flag that would make the library safe for the sink the result reaches. The library's output then runs: the HTML goes into a Handlebars triple-brace that declares its input safe; the class is deserialized with a constructor the attacker chose; the path is opened for write when the input was dot-dot; the script resolves java.lang.Runtime at the top of the host JVM; the Markdown's <script> renders; the LLM-emitted JSON task record constructs with allow_shell = true; the WordPress REST handler accepts post_type = wpcode and the shortcode evals the body.
The fix is almost always one line. no_markup = true. addPermission(NoTypePermission.NONE). '<', . allowed_classes => false. trust_remote_code=False. getScriptEngine(classFilter). from jinja2.sandbox import SandboxedEnvironment as Environment. ->authorize(...). 'capability_type' => 'wpcode'. LANGFLOW_CORS_ORIGINS=https://exact.host. The patch diff's size is a measurement of how small the required intervention was. The volume of exhibits that accept the same intervention is the measurement of how often the consumer did not reach for it.
The failure repeats because the API surface of the library does not force the consumer to confront the choice. A function that accepts the dangerous option as a default-valued parameter is callable without the parameter. A factory helper that wires the library's own preferred defaults is shorter than the constructor it wraps. A top-level module import is one line, and the sandbox submodule import is two. Shopper's Filament exhibit is the shape made quantitative: the chained ->authorize(...) method on the Action::make() builder is one syntactic unit, and the same commit that added it to twelve CVE-producing call sites added it to twenty-five more where no CVE had yet been filed. The dangerous call site is syntactically smaller, and syntactic size is the dimension developers minimize when the language gives them two options for the same effect. The library carried the safe path. The library did not carry it as the shorter path.
The distance between the safe primitive and the unsafe call site collapses across exhibits. EspoCRM and vm2 had the flags in the library and the call site in a separate project. Zyxel collapses the distance to the same organization: the library (an in-house DAL framework) and the consumer (zcfgFeDal_LoginPrivilege_Get) are both inside Zyxel. Everest Forms collapses it to fifty-four lines inside one foreach in one file. WPCode collapses it to a three-file gap inside one plugin where the same author who wrote wpcode_edit_php_snippets did not write 'capability_type' => 'wpcode'. AutoGPT collapses it to the default argument of one function in one codebase. The pattern's recurrence is independent of organizational distance; the mechanism is syntactic ergonomics, not communication failure.
Three cases are worth naming because they look adjacent and are not. Setting Was Advisory names the case where the consumer did pass the flag and a wrapper layer flipped it inside the library, with no log or callback. Default Is The Mitigation names the structure of a patch whose only change is moving a default value, leaving the unsafe code path reachable through the same request surface. Extension As Mitigation names a library that offers a generic subclass, callback, or hook framed in documentation as the safety handoff, without wiring any specific dangerous input to any specific primitive. Safe Mode Was Opt In names the state before any of those: the library exposed a specific safety primitive wired to a specific dangerous input, and the consumer did not engage it.
The patch commit in every exhibit is either the engagement or the version flip that removes the choice. Netty's strictLineParsing is the variant where the maintainer flipped the default and preserved the unsafe code path behind a flag; the pattern continues to describe the shipped binary of every operator who set the flag back for backwards compatibility. Fastjson's SafeMode and Mermaid's securityLevel: sandbox are the variant where the patch declines to flip the default and the advisory recommends the flag as a defense in depth measure. The audit-readable scope of the fix is a sentence in the advisory; the runtime behavior depends on every downstream developer reading the advisory, knowing a security mode exists, and remembering to toggle it.