<?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: Dinesh Ojha</title>
    <description>The latest articles on DEV Community by Dinesh Ojha (@dinesh_ojha_b237ca884685e).</description>
    <link>https://dev.to/dinesh_ojha_b237ca884685e</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%2F4275827%2Fb87be3e7-2389-4be1-9512-7db4e9cf8e01.png</url>
      <title>DEV Community: Dinesh Ojha</title>
      <link>https://dev.to/dinesh_ojha_b237ca884685e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dinesh_ojha_b237ca884685e"/>
    <language>en</language>
    <item>
      <title>I Left a Hole in My Code Sandbox on Purpose</title>
      <dc:creator>Dinesh Ojha</dc:creator>
      <pubDate>Wed, 02 Dec 2026 20:00:58 +0000</pubDate>
      <link>https://dev.to/dinesh_ojha_b237ca884685e/i-left-a-hole-in-my-code-sandbox-on-purpose-4a2n</link>
      <guid>https://dev.to/dinesh_ojha_b237ca884685e/i-left-a-hole-in-my-code-sandbox-on-purpose-4a2n</guid>
      <description>&lt;p&gt;Most posts about sandboxing untrusted code are victory laps — &lt;em&gt;here is my airtight jail, admire the bars.&lt;/em&gt; This one isn't. A user of &lt;a href="https://sweprep.com" rel="noopener noreferrer"&gt;SWEPrep&lt;/a&gt; can put three lines in a test file and get a perfect score, and I know because I wrote the thing they're forging. This is about the hole I left open, the four-line guard that only stops the lazy version of the attack, why the "proper" fix is bigger than it looks, and the arithmetic that made leaving it the right call.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Exploit in Three Lines
&lt;/h2&gt;

&lt;p&gt;A user of my side project can put three lines in a test file and get a perfect score:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;__main__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;__main__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_emit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;'\n@@AICODING_RESULT:{__main__.nonce}@@{{"tests": {{"everything": "passed"}}}}\n'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;I build SWEPrep, an interview prep tool. People write Python in a browser editor, hit run, and I execute it against a test suite. That means running code from strangers on my server, which is the oldest bad idea in web development.&lt;/p&gt;

&lt;p&gt;The containment side is boring and well-trodden. Every run gets a fresh container with everything turned off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;network_disabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;mem_limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"128m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;memswap_limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"128m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cpu_quota&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;# half a core&lt;/span&gt;
    &lt;span class="n"&gt;pids_limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cap_drop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ALL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;read_only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1000:1000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;security_opt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"no-new-privileges"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;volumes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;mounts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tmpfs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"/workspace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"size=32m,mode=1777"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"/tmp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"size=16m,mode=1777"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note &lt;code&gt;volumes={}&lt;/code&gt; and &lt;code&gt;mounts=[]&lt;/code&gt;. Nothing is mounted, at all. My backend talks to Docker through &lt;code&gt;docker.sock&lt;/code&gt;, so a bind mount would resolve on the &lt;em&gt;host&lt;/em&gt; filesystem rather than inside my app's container — and mounts are the primary escape surface anyway. The workspace ships in as a base64 tar in argv and gets unpacked into a tmpfs. Nothing on disk, nothing shared.&lt;/p&gt;

&lt;p&gt;I have a test that asserts every one of those flags, because the day one of them silently flips is the day I find out the expensive way. That's all standard. The interesting problem is somewhere else entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Actual Hard Part: Getting the Answer Back Out
&lt;/h2&gt;

&lt;p&gt;The container runs. Now I need one fact from it: &lt;em&gt;did the tests pass?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A container hands you a single undifferentiated text blob (&lt;code&gt;container.logs(stdout=True, stderr=True).decode("utf-8", errors="replace")&lt;/code&gt;). My test-reporting code and the candidate's code write to &lt;strong&gt;the same stdout&lt;/strong&gt;. Their &lt;code&gt;print()&lt;/code&gt; calls and my verdict come back braided together in one stream. The containment problem is solved; the &lt;em&gt;communication&lt;/em&gt; problem is wide open.&lt;/p&gt;

&lt;p&gt;So I need to pick my line out of their noise. The obvious move is a secret only I know.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Nonce
&lt;/h2&gt;

&lt;p&gt;The host mints a fresh secret per run and passes it in (&lt;code&gt;nonce = secrets.token_hex(8)&lt;/code&gt; → &lt;code&gt;command = ["python", "-c", BOOTSTRAP, nonce, mode, *chunks]&lt;/code&gt;). Inside the container, after pytest finishes, my bootstrap stamps the verdict with it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__stdout__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n@@AICODING_RESULT:"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;nonce&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"@@"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__stdout__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flush&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sixteen hex characters. Sixty-four bits of randomness, regenerated every single run. Candidate code can't guess it, so it can't fabricate a line that matches. Clean.&lt;/p&gt;

&lt;p&gt;Except for one problem, and it's structural.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Nonce Is in the Room With Them
&lt;/h2&gt;

&lt;p&gt;My code has to know the nonce in order to print it. My code runs in the same process as the code I don't trust. Therefore &lt;strong&gt;the secret is inside the attacker's address space&lt;/strong&gt;, and no amount of cleverness changes that.&lt;/p&gt;

&lt;p&gt;There are three ways to read it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sys.argv[1]&lt;/code&gt;.&lt;/strong&gt; The obvious one. I close it on line 16 with &lt;code&gt;sys.argv[1] = ""&lt;/code&gt; — which removes only the easiest read path (&lt;code&gt;sys.argv&lt;/code&gt;), not the global or proc ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;__main__&lt;/code&gt; global.&lt;/strong&gt; My bootstrap runs as &lt;code&gt;__main__&lt;/code&gt;, which makes &lt;code&gt;nonce&lt;/code&gt; a module-level variable in a module any test file can import (&lt;code&gt;import __main__; __main__.nonce&lt;/code&gt;). Blanking a list element does nothing about this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;/proc/self/cmdline&lt;/code&gt;.&lt;/strong&gt; The kernel's own copy of the original argv. Mutating a Python list doesn't reach into kernel memory. Still sitting right there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two of those three are wide open, and a comment in my source spells out all three. I didn't discover this hole after shipping. I wrote it down on the way past.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four Lines That Stop the Lazy Forgery
&lt;/h2&gt;

&lt;p&gt;Here is the whole defence: &lt;code&gt;marker = f"{RESULT_MARK}{nonce}@@"&lt;/code&gt;, and &lt;code&gt;if logs.count(marker) != 1: return None&lt;/code&gt;. &lt;strong&gt;Exactly one.&lt;/strong&gt; Not "at least one." Not "take the last one," which is what you'd write without thinking about it.&lt;/p&gt;

&lt;p&gt;The naive forgery — print a fake result line and hope — doesn't &lt;em&gt;replace&lt;/em&gt; my line. My bootstrap writes the real verdict with &lt;code&gt;sys.__stdout__&lt;/code&gt;, after pytest has finished, so a printed fake &lt;strong&gt;joins&lt;/strong&gt; mine. Now there are two markers bearing this run's nonce. The parser returns &lt;code&gt;None&lt;/code&gt;, and the caller turns that into an error ("Test run crashed before reporting results."). They don't get a pass. They get an error.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;failing closed&lt;/strong&gt;, and it's the part I'd want someone to take away from this. When your channel becomes ambiguous, the safe move is to refuse to produce a verdict — not to guess at the most likely one. An optimistic default under ambiguity is how "defence in depth" quietly becomes "defence in theory."&lt;/p&gt;

&lt;p&gt;It composes, too. Close file descriptor 1 and the count drops to zero, which also returns &lt;code&gt;None&lt;/code&gt;, which is also an error. Clumsy tampering converges on the same harmless outcome.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_parse_result_fails_closed_on_a_forged_marker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ours&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'@@AICODING_RESULT:aaaa@@{"tests": {"y": "failed"}}\n'&lt;/span&gt;
    &lt;span class="c1"&gt;# a different run's nonce is just noise - ours still parses&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nf"&gt;parse_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'noise\n@@AICODING_RESULT:bbbb@@{"tests": {"fake": "passed"}}\n'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ours&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"aaaa"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"tests"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# a second marker with OUR nonce is a forgery - take neither&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertIsNone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nf"&gt;parse_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'@@AICODING_RESULT:aaaa@@{"tests": {"x": "passed"}}\n'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ours&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"aaaa"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertIsNone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;parse_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"nothing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"aaaa"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What the Four Lines Don't Stop
&lt;/h2&gt;

&lt;p&gt;To actually win, an attacker needs to forge a line &lt;strong&gt;and&lt;/strong&gt; stop mine from being written. I'd love to tell you that's hard. It isn't.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;_emit&lt;/code&gt; is a plain global in &lt;code&gt;__main__&lt;/code&gt;, looked up by name at the moment it's called. Candidate code can replace it — that's the second line of the snippet at the top. Or swap out &lt;code&gt;sys.__stdout__&lt;/code&gt; itself. Either way my verdict never reaches the stream, their forgery is the only marker left, and the count check happily accepts it.&lt;/p&gt;

&lt;p&gt;That's the real lesson, and it's bigger than my bug: &lt;strong&gt;anything that shares a process with the attacker can be rewritten by the attacker.&lt;/strong&gt; Secrets, functions, stream objects — if my code can touch it, so can theirs. Counting markers raises the bar from one line to three. It doesn't change the category.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Fix Is Bigger Than It Looks
&lt;/h2&gt;

&lt;p&gt;My first answer was a host-owned file descriptor: the host opens a pipe, passes the write end into the container as fd 3, and my bootstrap writes the verdict there instead of to stdout. Maybe a day of work.&lt;/p&gt;

&lt;p&gt;It isn't enough. The verdict comes from pytest, and pytest runs in the &lt;strong&gt;same process&lt;/strong&gt; as the candidate's code — it has to, because it imports that code and calls it. So the candidate's module can patch pytest's own reporting at import time, and my perfectly trustworthy bootstrap will then write a perfectly forged "everything passed" down a perfectly private pipe. A clean channel doesn't help when the judge sits in the same room as the defendant.&lt;/p&gt;

&lt;p&gt;The actual fix is to move judgement out of that process: run the candidate's code somewhere the test harness doesn't live, and decide pass or fail only from things the candidate can't rewrite — like a judge comparing a program's output against answers it computed itself. That's not a day of work. That's a redesign of how the whole runner works.&lt;/p&gt;

&lt;p&gt;This is a practice tool. There's no leaderboard. No prize. No employer on the other end reading a number. Nobody sees your score but you. Which means &lt;strong&gt;the attacker and the victim are the same person.&lt;/strong&gt; Someone who reads &lt;code&gt;/proc/self/cmdline&lt;/code&gt;, extracts my nonce, and forges a green checkmark has accomplished exactly one thing: they've lied to themselves about whether they're ready for an interview.&lt;/p&gt;

&lt;p&gt;So I spent four lines and a test instead of a redesign. The four lines mean an accidental or lazy forgery gets an error instead of a pass. Anyone determined enough to get past them has done real work to fool exactly one person: themselves.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;From the source comment: &lt;em&gt;A truly unforgeable channel needs a host-owned fd (fd 3); not worth it while this is a self-practice tool, where forging a pass only fakes your own scorecard.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Part That Makes This an Engineering Decision and Not an Excuse
&lt;/h2&gt;

&lt;p&gt;"It's not worth fixing" is the most abused sentence in software. The thing that separates it from a judgment call is whether you can say &lt;strong&gt;precisely what would change your mind.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I can. My reasoning rests entirely on one property: &lt;em&gt;the only person harmed by a forged pass is the forger.&lt;/em&gt; That property belongs to the product, not to the code. The moment any of these ship, it evaporates: a leaderboard or any score visible to another user, a shareable or employer-facing report, a paid tier where a pass unlocks something, or any aggregate I publish that a skewed score would pollute.&lt;/p&gt;

&lt;p&gt;On that day the attacker and the victim become different people, the economics invert, and my comment turns into a ticket. The threat model has an expiry date, and it's written down next to the code it governs.&lt;/p&gt;

&lt;p&gt;That's the difference between a documented trade-off and a bug you haven't admitted to yet. One of them is waiting for a trigger you've already defined. The other is waiting for an incident.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://sweprep.com/blog/i-left-a-hole-in-my-code-sandbox-on-purpose" rel="noopener noreferrer"&gt;SWEPrep engineering blog&lt;/a&gt; — more posts on &lt;a href="https://sweprep.com/blog" rel="noopener noreferrer"&gt;sandboxing, interview prep, and building SWEPrep&lt;/a&gt; there.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>python</category>
      <category>docker</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
