<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shuliak11</title>
    <description>The latest articles on DEV Community by Shuliak11 (@shuliak11).</description>
    <link>https://dev.to/shuliak11</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4280474%2F0ffd35e9-5f6d-4e3c-9541-64a57b84a3ab.png</url>
      <title>DEV Community: Shuliak11</title>
      <link>https://dev.to/shuliak11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shuliak11"/>
    <language>en</language>
    <item>
      <title>Securing Local MCP stdio Pipes with RFC 8785 Schema Locks and NIST FF1 Twins</title>
      <dc:creator>Shuliak11</dc:creator>
      <pubDate>Thu, 03 Dec 2026 11:27:04 +0000</pubDate>
      <link>https://dev.to/shuliak11/securing-local-mcp-stdio-pipes-with-rfc-8785-schema-locks-and-nist-ff1-twins-1e75</link>
      <guid>https://dev.to/shuliak11/securing-local-mcp-stdio-pipes-with-rfc-8785-schema-locks-and-nist-ff1-twins-1e75</guid>
      <description>&lt;p&gt;Enterprise network controls assume AI traffic crosses an HTTP proxy. For roughly a third of Model Context Protocol (MCP) setups on developer laptops, that assumption fails.&lt;/p&gt;

&lt;p&gt;When Cursor, Claude Code, VS Code, Windsurf, or OpenAI Codex CLI reads &lt;code&gt;.cursor/mcp.json&lt;/code&gt;, &lt;code&gt;.mcp.json&lt;/code&gt;, or &lt;code&gt;config.toml&lt;/code&gt;, the IDE spawns a child process (&lt;code&gt;npx&lt;/code&gt;, &lt;code&gt;uvx&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt;, or a local binary) and speaks newline-delimited JSON-RPC 2.0 over OS file descriptors &lt;code&gt;fd 0&lt;/code&gt; (&lt;code&gt;stdin&lt;/code&gt;) and &lt;code&gt;fd 1&lt;/code&gt; (&lt;code&gt;stdout&lt;/code&gt;). No TLS proxy inspects that pipe. Cloud CASBs and API gateways sit out of path until the host IDE has already pulled raw database rows, payment card numbers, or poisoned tool schemas into its prompt context.&lt;/p&gt;

&lt;p&gt;While writing the IETF Internet-Draft &lt;code&gt;draft-shuliak-sip-zero-egress-01&lt;/code&gt; and building &lt;code&gt;@shuliak-corp/sip1-mcp&lt;/code&gt; (&lt;code&gt;v3.1.0&lt;/code&gt;, Apache-2.0), I kept two strict rules: &lt;strong&gt;zero runtime npm dependencies&lt;/strong&gt; (pure Node.js &lt;code&gt;&amp;gt;= 20&lt;/code&gt; built-ins so anyone can audit the tarball) and &lt;strong&gt;zero outbound network sockets&lt;/strong&gt; at runtime.&lt;/p&gt;

&lt;p&gt;Below are four protocol failure modes we hit on raw MCP &lt;code&gt;stdio&lt;/code&gt; streams, why static masking breaks downstream tools, and where this layer stops.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;code&gt;JSON.stringify&lt;/code&gt; Is Not Canonical: Stopping Tool Rug Pulls (&lt;code&gt;0x06&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;An MCP server declares its capabilities via &lt;code&gt;tools/list&lt;/code&gt;. A developer approves a benign read-only tool once and moves on. Later (or after an unpinned &lt;code&gt;@latest&lt;/code&gt; update), the server mutates a description or flips &lt;code&gt;readOnlyHint: true&lt;/code&gt; to &lt;code&gt;destructiveHint: true&lt;/code&gt; while injecting instructions into an argument schema.&lt;/p&gt;

&lt;p&gt;Hashing &lt;code&gt;JSON.stringify(tool)&lt;/code&gt; fails across runtimes and misses two wire-level parser differentials:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate JSON keys:&lt;/strong&gt; A raw frame containing &lt;code&gt;{"role":"viewer","role":"admin"}&lt;/code&gt; behaves differently between lenient scanners and V8 &lt;code&gt;JSON.parse&lt;/code&gt; (which takes the last key). Our frame guard (&lt;code&gt;detectDuplicateJsonKeys&lt;/code&gt; + &lt;code&gt;cleanProtoKeys&lt;/code&gt;) rejects duplicate keys and &lt;code&gt;__proto__&lt;/code&gt; / &lt;code&gt;constructor&lt;/code&gt; fields before routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unicode Plane-14 and BiDi smuggling (&lt;code&gt;SIP-R03&lt;/code&gt;):&lt;/strong&gt; Codepoints in the Tags block (&lt;code&gt;U+E0000..U+E007F&lt;/code&gt;) and bidirectional overrides (&lt;code&gt;U+061C&lt;/code&gt;, &lt;code&gt;U+202A..U+202E&lt;/code&gt;, &lt;code&gt;U+2066..U+2069&lt;/code&gt;) render as blank space in terminal diffs while remaining legible to model tokenizers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In &lt;code&gt;src/core/jcs.mjs&lt;/code&gt;, we implemented &lt;strong&gt;RFC 8785 JSON Canonicalization Scheme (JCS)&lt;/strong&gt;: keys sort by UTF-16 code units, lone surrogates (&lt;code&gt;!str.isWellFormed()&lt;/code&gt;) throw immediately, and canonical UTF-8 bytes are hashed under domain prefix &lt;code&gt;0x06&lt;/code&gt; (&lt;code&gt;SIP-v3-STAGE1-SCHEMA-LOCK&lt;/code&gt;) and signed with a local &lt;strong&gt;Ed25519&lt;/strong&gt; key (&lt;code&gt;RFC 8032&lt;/code&gt;). Any mid-session schema byte change fails closed before reaching the IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why &lt;code&gt;[REDACTED]&lt;/code&gt; Breaks Payment Workflows: BigInt NIST FF1 Twins
&lt;/h2&gt;

&lt;p&gt;Replacing a 16-digit PAN or 22-character SEPA IBAN with &lt;code&gt;[REDACTED]&lt;/code&gt; breaks SQL column checks, Luhn Modulo-10 validators, and ISO 7064 MOD 97-10 rules. Worse, if two cardholders appear in one incident log, masking both as &lt;code&gt;[REDACTED]&lt;/code&gt; destroys co-reference.&lt;/p&gt;

&lt;p&gt;Three constraints shaped &lt;code&gt;src/stage3/nist-ff1-twins.mjs&lt;/code&gt; (&lt;code&gt;rawToTwin&lt;/code&gt; outbound to the model, &lt;code&gt;twinToRaw&lt;/code&gt; inbound on &lt;code&gt;tools/call&lt;/code&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;FF1 only, never FF3 or FF3-1.&lt;/strong&gt; NIST withdrew FF3-1 after cryptanalytic breaks; only the 10-round Feistel mode &lt;strong&gt;FF1&lt;/strong&gt; in &lt;strong&gt;NIST SP 800-38G Rev. 1&lt;/strong&gt; remains standardized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arbitrary-precision &lt;code&gt;BigInt&lt;/code&gt; and the &lt;code&gt;1,000,000&lt;/code&gt; domain floor.&lt;/strong&gt; JavaScript &lt;code&gt;Number&lt;/code&gt; loses integer precision above &lt;code&gt;2^53 - 1&lt;/code&gt;, corrupting 16-to-19-digit cards and 30-char IBANs in modular rounds. Every radix step runs on native &lt;code&gt;BigInt&lt;/code&gt; over cached &lt;code&gt;node:crypto&lt;/code&gt; &lt;code&gt;aes-256-ecb&lt;/code&gt;, verified against all &lt;strong&gt;9/9 official NIST CAVP FF1 test vectors&lt;/strong&gt;. Inputs below &lt;code&gt;radix^len &amp;lt; 1,000,000&lt;/code&gt; bypass FF1 and route to domain-separated HMAC-SHA256.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateless check-digit reconstruction.&lt;/strong&gt; For a valid card &lt;code&gt;X = P || c_orig&lt;/code&gt;, we encrypt the payload &lt;code&gt;P' = FF1_Encrypt(K, T, P)&lt;/code&gt; and append &lt;code&gt;c_new = Luhn(P')&lt;/code&gt;. On inbound rehydration, we strip &lt;code&gt;c_new&lt;/code&gt;, invert &lt;code&gt;P = FF1_Decrypt(K, T, P')&lt;/code&gt;, and recompute &lt;code&gt;c_orig = Luhn(P)&lt;/code&gt; with zero external vault. SEPA IBANs use the same cycle-walking invariant under ISO 7064 MOD 97-10 (&lt;code&gt;98 - (N mod 97)&lt;/code&gt;). Median in-RAM latency sits between &lt;code&gt;0.08 ms&lt;/code&gt; and &lt;code&gt;0.65 ms&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Pre-Tool AST Guard and Atomic FinOps Breakers (&lt;code&gt;&amp;lt; 0.25 ms&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;System prompts cannot stop an agent loop from running &lt;code&gt;DROP TABLE&lt;/code&gt;, mounting &lt;code&gt;/&lt;/code&gt;, or burning &lt;code&gt;$200&lt;/code&gt; on a failing query. Before forwarding &lt;code&gt;tools/call&lt;/code&gt;, &lt;code&gt;SipPipelineBus&lt;/code&gt; (&lt;code&gt;src/stage2/guard-runner.mjs&lt;/code&gt;) runs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Canary Tripwire (&lt;code&gt;SIP-CANARY&lt;/code&gt;):&lt;/strong&gt; Touching a planted honeytoken locks the workspace and revokes active leases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL/Shell Blast-Radius Classifier (&lt;code&gt;&amp;lt; 0.25 ms&lt;/code&gt;):&lt;/strong&gt; Blocks &lt;code&gt;DROP&lt;/code&gt;, &lt;code&gt;TRUNCATE&lt;/code&gt;, unscoped &lt;code&gt;DELETE&lt;/code&gt;, recursive &lt;code&gt;rm&lt;/code&gt;, &lt;code&gt;--dangerously-skip-permissions&lt;/code&gt;, and &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;.env&lt;/code&gt; mounts with exit code &lt;code&gt;2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic FinOps &amp;amp; Loop Fuse (&lt;code&gt;finops-fuse.mjs&lt;/code&gt;):&lt;/strong&gt; &lt;code&gt;SIP-F01&lt;/code&gt; trips above 25 calls per 10s or &lt;code&gt;$5.00&lt;/code&gt; session spend; &lt;code&gt;SIP-F02&lt;/code&gt; hashes &lt;code&gt;(server, tool, normalizedActionDigest)&lt;/code&gt; and halts the &lt;strong&gt;4th identical retry&lt;/strong&gt; within 60 seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stage 3/4 (&lt;code&gt;isep-engine.mjs&lt;/code&gt;, &lt;code&gt;pdf-generator.mjs&lt;/code&gt;) records zero-PII &lt;strong&gt;RFC 9162&lt;/strong&gt; Merkle proofs (&lt;code&gt;0x0B&lt;/code&gt;), GDPR Art. 17 salt shredding, &lt;strong&gt;CycloneDX 1.6 AIBOM&lt;/strong&gt; JSON, and pure-JS vector &lt;code&gt;%PDF-1.7&lt;/code&gt; certificates verifiable offline via WebCrypto.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Quick Offline Check (Zero Sign-Up, 0 Sockets)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Audit local MCP configs across 12+ AI IDEs offline&lt;/span&gt;
npx -y @shuliak-corp/sip1-mcp@3.1.0 audit

&lt;span class="c"&gt;# Run the zero-socket tripwire + 3s sandbox demo&lt;/span&gt;
npx -y @shuliak-corp/sip1-mcp@3.1.0 demo

&lt;span class="c"&gt;# Wrap existing stdio MCP servers (1-cmd rollback)&lt;/span&gt;
npx -y @shuliak-corp/sip1-mcp@3.1.0 shield --apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(For Jira Cloud and JSM teams, we also run the same zero-egress NIST FF1 and WebCrypto engine inside native **Runs on Atlassian&lt;/em&gt;* Forge apps on &lt;code&gt;@forge/kvs&lt;/code&gt;, including &lt;a href="https://marketplace.atlassian.com/apps/1888208571" rel="noopener noreferrer"&gt;PII, Credit Card &amp;amp; Secret Shield&lt;/a&gt; for &lt;code&gt;JRACLOUD-71685&lt;/code&gt; changelog leaks and &lt;a href="https://marketplace.atlassian.com/apps/190460125" rel="noopener noreferrer"&gt;AegisVault&lt;/a&gt;.)*&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Where This Breaks: Non-Goals and Boundaries
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Structured identifiers, not prose NER.&lt;/strong&gt; SIP-1 catches keys, DSNs, PANs, IBANs, national/clinical IDs, and &lt;code&gt;.docx&lt;/code&gt;/&lt;code&gt;.xlsx&lt;/code&gt;/&lt;code&gt;.pdf&lt;/code&gt;/&lt;code&gt;HL7&lt;/code&gt;/&lt;code&gt;FHIR&lt;/code&gt; fields, not free-text narrative secrets without structured tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same-UID local edits without MDM.&lt;/strong&gt; On an unmanaged laptop, a user with local write access can edit &lt;code&gt;~/.cursor/mcp.json&lt;/code&gt;. Enforcing non-bypassable configs requires OS MDM profiles (&lt;code&gt;mdm-export&lt;/code&gt; via Jamf or Intune).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct remote HTTP MCP.&lt;/strong&gt; &lt;code&gt;stdio&lt;/code&gt; wrapping covers local tool processes; remote OAuth HTTP endpoints not bridged over &lt;code&gt;stdio&lt;/code&gt; sit outside &lt;code&gt;fd 0/1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical telemetry, not legal certification.&lt;/strong&gt; Signed ISEP v3.0 PDFs are deterministic software evidence (&lt;code&gt;AS IS&lt;/code&gt;), not third-party audit, accounting, or legal opinions.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Links &amp;amp; Specifications
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub (Apache-2.0, SLSA v1 provenance):&lt;/strong&gt; &lt;a href="https://github.com/Shuliak11/sip1-mcp-firewall" rel="noopener noreferrer"&gt;https://github.com/Shuliak11/sip1-mcp-firewall&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IETF Draft (&lt;code&gt;draft-shuliak-sip-zero-egress-01&lt;/code&gt;):&lt;/strong&gt; &lt;a href="https://datatracker.ietf.org/doc/draft-shuliak-sip-zero-egress/" rel="noopener noreferrer"&gt;https://datatracker.ietf.org/doc/draft-shuliak-sip-zero-egress/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CERN Zenodo Corpus:&lt;/strong&gt; &lt;a href="https://doi.org/10.5281/zenodo.24159380" rel="noopener noreferrer"&gt;https://doi.org/10.5281/zenodo.24159380&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs &amp;amp; Offline Verifier:&lt;/strong&gt; &lt;a href="https://shuliak.dev/docs" rel="noopener noreferrer"&gt;https://shuliak.dev/docs&lt;/a&gt; &lt;em&gt;(Open-Core is free under Apache-2.0; engineering teams expensing annual CI or Vanta/Drata compliance seats before Dec 31 can use &lt;code&gt;Q4LOCK20&lt;/code&gt; for 20% off at &lt;a href="https://shuliak.dev/pricing" rel="noopener noreferrer"&gt;https://shuliak.dev/pricing&lt;/a&gt;).&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>node</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
