[{"data":1,"prerenderedAt":1263},["ShallowReactive",2],{"blog-post:claude-code-deleted-everything":3},{"post":4,"page":1144,"authors":1189,"others":1199,"figures":1220},{"path":5,"title":6,"subHeading":7,"date":8,"authors":9,"description":11,"topics":12,"icon":15,"related":16,"leaders":20,"quote":21,"engineers":22,"image":23,"readingTime":27,"body":28},"/blog/claude-code-deleted-everything","Claude Code Deleted Everything","…and all I got were these lousy 0-days.","2026-04-30",[10],"trey","A deleted codebase, a recovery tool, a confirmed bug in Claude Code, and command injection in four shell prompt frameworks.",[13,14],"Research","AI","magnifier",[17,18,19],"the-expensive-step-is-getting-firmware-to-run","a-firmware-release-is-a-disclosure","device-security-in-the-world-of-ai","A known bug in Claude Code merged two commands into one and deleted an engineer’s project, git history included. Recovering it led to command injection in four shell prompts, Tide, Prezto, Spaceship and Liquidprompt, that runs when you open the wrong folder. All four are disclosed and fixed in maintained versions, and the Liquidprompt bug is CVE-2026-27113. Ask your team what an AI coding agent on their machines can delete and where they would restore it from.","Claude tried to be more careful, and that’s what killed the project.","Bring your agent setup and your shell prompt. We’ll talk about what each one runs.",{"src":24,"share":25,"alt":26},"/blog/empty-office.avif","/blog/empty-office-share.jpg","An empty office floor with bare concrete and a long wall of windows, in black and white",15,{"type":29,"value":30,"toc":1119},"minimark",[31,36,48,54,57,65,69,72,82,85,88,94,101,105,116,123,129,132,135,143,157,165,168,171,175,186,189,193,200,205,208,211,216,223,232,235,241,259,262,267,270,276,279,283,298,459,472,478,511,514,517,527,533,541,546,555,558,560,563,676,689,693,707,713,729,736,739,745,762,781,787,803,809,812,830,845,850,856,860,883,889,892,895,903,920,926,958,964,968,979,985,995,1003,1010,1016,1032,1036,1042,1045,1106,1110,1113,1116],[32,33,35],"h2",{"id":34},"the-setup","The setup",[37,38,39,40,47],"p",{},"At Crystal Peak, we do detail-oriented client work by hand. But in our spare time, we throw side projects at AI - stuff we wouldn’t have bandwidth for otherwise. One of those: ",[41,42,46],"a",{"href":43,"rel":44},"https://github.com/CrystalPeakSecurity/jcc",[45],"nofollow","jcc",".",[37,49,50,53],{},[51,52,46],"code",{},", a compiler for JavaCard bytecode, lets you write performant JavaCard applets in C (and soon, rust!). Keep an eye out - we’ll write up how we ported DOOM to your credit card.",[37,55,56],{},"I was in the middle of a major refactor, translating jcc’s direct compilation model to one that takes in LLVM IR.",[37,58,59,60,64],{},"I knew this would be an undertaking, but had no idea ",[61,62,63],"em",{},"just how complex"," things can get with LLVM. This rewrite took over 3x as long as the original implementation. But things were going well, I had just crossed off the last milestone: adding a peephole optimization pass at the end of the pipeline. The finish line was in sight.",[32,66,68],{"id":67},"the-moment","The moment",[37,70,71],{},"I left the agent running in the background while I took care of a few things. I check back and see it asking for permission to run this command:",[73,74,80],"pre",{"className":75,"code":77,"language":78,"meta":79},[76],"language-shell","rm -rf examples/minimal/build/*.cap examples/minimal/build/*.jca 2>/dev/null\nuv run python -m backend3 examples/minimal --jcc-root . 2>&1 | tail -3\n","shell","",[51,81,77],{"__ignoreMap":79},[37,83,84],{},"Harmless, right? No, really - look at it. Tell me. It’s harmless, right?",[37,86,87],{},"I approved it.",[37,89,90,91],{},"I come back to a flurry of errors. ",[51,92,93],{},"Path does not exist: examples/minimal",[37,95,96,97,100],{},"I run ",[51,98,99],{},"ls",". Nothing is there. Not even the folder for the project. Just silence filling the space hours of work used to occupy.",[32,102,104],{"id":103},"the-recovery","The recovery",[37,106,107,108,111,112,115],{},"It’s a strange feeling, having many hours of work disappear. Normally I’d just ",[51,109,110],{},"git checkout"," to get back to a clean state... but the whole folder here was deleted, ",[51,113,114],{},".git"," included. This being a messy side project, I hadn’t pushed it anywhere. It was truly gone.",[37,117,118,119,122],{},"Except: I remembered from an earlier spelunking session that Claude Code keeps all conversation history in ",[51,120,121],{},"~/.claude",". Maybe I could use that to recover the plan files I had created, at least? A small faint light emerges.",[32,124,126,127],{"id":125},"a-journey-through-claude","A journey through ",[51,128,121],{},[37,130,131],{},"Claude keeps a lot of files around in this folder. On my machine, it’s many gigabytes of data. By default, most things in here are deleted after 30 days.",[37,133,134],{},"Taking a look in the directory:",[73,136,141],{"className":137,"code":139,"language":140},[138],"language-text","cache/           - Unsure, only contains changelog.md\ndebug/           - Claude internal debug logs\nfile-history/    - Snapshots of files (!!!)\nhistory.jsonl    - Used for ctrl+r in the Claude prompt\nide/             - IDE integration...?\npaste-cache/     - Everything you've pasted\nplans/           - All plan files\nplugins/         - Plugin system machinery\nprojects/        - All of your projects, keyed by directory name\nsession-env/     - Unsure\nsettings.json    - Basic global settings\nshell-snapshots/ - Bootstrap shell scripts...?\nstats-cache.json - Historical model usage stats\nstatsig/         - A/B testing, feature flags, and user analysis\ntasks/           - Tasks - newer form of TodoList?\ntelemetry/       - Unsure exactly what telemetry this is\ntodos/           - TodoList entries\n","text",[51,142,139],{"__ignoreMap":79},[37,144,145,148,149,152,153,156],{},[51,146,147],{},"plans/"," is right there, so getting that data back should be easy. And ",[51,150,151],{},"file-history/"," is what powers the “rewind” feature when you roll back a conversation - my data should be in there! The files have random names, but can be correlated back to their original paths using the conversation logs. The conversation log is stored as a ",[51,154,155],{},".jsonl"," file - each line is a json entry. The structure is beyond the scope of this article, but for reference, here’s a snapshot line, pretty-printed:",[73,158,163],{"className":159,"code":161,"language":162,"meta":79},[160],"language-json","{\n  \"type\": \"file-history-snapshot\",\n  \"messageId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n  \"snapshot\": {\n    \"messageId\": \"12345678-abcd-4def-9876-fedcba987654\",\n    \"trackedFileBackups\": {\n      \"src/claude-decoder/models.py\": {\n        \"backupFileName\": \"ab12cd34ef56gh78@v1\",\n        \"version\": 1,\n        \"backupTime\": \"2025-06-15T14:30:22.041Z\"\n      }\n    },\n    \"timestamp\": \"2025-06-15T14:29:58.123Z\"\n  },\n  \"isSnapshotUpdate\": true\n}\n","json",[51,164,161],{"__ignoreMap":79},[37,166,167],{},"My snapshots were incomplete - they didn’t have all my files.",[37,169,170],{},"In my case, the better approach turned out to be replaying tool invocations from the conversation log directly. The conversation log has every tool call (such as Read, Write, Edit, and Bash) from every session. Reads show partial or full file content. Writes create or overwrite a whole file. Edits record incremental changes. So the approach here was to find the latest Read or Write, then replay any subsequent Edits on top of it - reconstructing the file to its exact state at the moment everything was deleted.",[32,172,174],{"id":173},"the-tool","The Tool",[37,176,177,178,185],{},"I hacked together a tool to automate this and got my codebase back, all the way up to the last edit before the deletion. That tool is ",[41,179,182],{"href":180,"rel":181},"https://github.com/CrystalPeakSecurity/claude-decoder",[45],[51,183,184],{},"claude-decoder"," - it parses Claude Code’s session logs, reconstructs source files with diff previews, and lets you browse, search, or export conversation history.",[37,187,188],{},"So, this is just another one of those “AI ate my homework” stories, but with a data recovery twist, right? We should end this post here?",[32,190,192],{"id":191},"ai-did-not-eat-my-homework","AI did not eat my homework",[37,194,195,196,199],{},"I started digging through the conversation history to figure out exactly where the project could have been deleted. Re-reading the conversation, I came to the conclusion that it ",[61,197,198],{},"must"," have been this one command:",[73,201,203],{"className":202,"code":77,"language":78,"meta":79},[76],[51,204,77],{"__ignoreMap":79},[37,206,207],{},"Here’s a challenge: figure out how this command would delete the entire project.",[37,209,210],{},"I read this command, I asked coworkers to read this command, and none of us could explain how it had caused the entire project to be deleted. Even with some wild shell globbing, none of the filenames I had could have caused this behavior.",[212,213,215],"h3",{"id":214},"ai-sorta-ate-my-homework","AI sorta ate my homework",[37,217,218,219,222],{},"Do you know how Claude Code works? Do you ",[61,220,221],{},"really"," know how Claude Code works?",[37,224,225,226,231],{},"It’s a big project. In a particularly wild note, one of the developers ",[41,227,230],{"href":228,"rel":229},"https://x.com/trq212/status/2014051501786931427",[45],"described it"," as closer to “a small game engine” than a TUI. It constructs a React scene graph, lays out elements, rasterizes to a 2D screen, diffs against the previous frame, and generates ANSI sequences to write to your terminal. There’s a lot going on here. It’s also entirely coded with Claude Code.",[37,233,234],{},"There’s also a lot going on with command execution. Commands aren’t passed straight to the shell as they’re presented to you. Claude Code wraps your input in an execution harness:",[73,236,239],{"className":237,"code":238,"language":78,"meta":79},[76],"/bin/bash -lc 'source [shell-snapshot] && eval \"[your-command]\" \u003C /dev/null && pwd -P >| [cwd-tracking-file]'\n",[51,240,238],{"__ignoreMap":79},[37,242,243,244,247,248,252,253,258],{},"When a command contains a pipe (",[51,245,246],{},"|","), preprocessing logic restructures the command to handle this redirect. There’s a ",[249,250,251],"strong",{},"known, still-open bug"," (",[41,254,257],{"href":255,"rel":256},"https://github.com/anthropics/claude-code/issues/15599",[45],"GitHub Issue #15599",") where this preprocessing collapses newlines to spaces when a pipe is present, merging what should be separate commands into one.",[37,260,261],{},"The original two-line command that Claude generated:",[73,263,265],{"className":264,"code":77,"language":78,"meta":79},[76],[51,266,77],{"__ignoreMap":79},[37,268,269],{},"Became a single line. Something along the lines of:",[73,271,274],{"className":272,"code":273,"language":78,"meta":79},[76],"rm -rf examples/minimal/build/*.cap examples/minimal/build/*.jca 2>/dev/null uv run python -m backend3 examples/minimal --jcc-root . 2>&1 | tail -3\n",[51,275,273],{"__ignoreMap":79},[37,277,278],{},"See it now?",[32,280,282],{"id":281},"the-deletion-anatomy","The Deletion Anatomy",[37,284,285,286,289,290,293,294,297],{},"Every token after ",[51,287,288],{},"2>/dev/null"," that was meant for ",[51,291,292],{},"uv run"," became an argument to ",[51,295,296],{},"rm -rf",":",[299,300,301,321],"table",{},[302,303,304],"thead",{},[305,306,307,312,315],"tr",{},[308,309,311],"th",{"align":310},"left","Argument",[308,313,314],{"align":310},"Intended for",[308,316,317,318,320],{"align":310},"What ",[51,319,296],{}," did with it",[322,323,324,338,349,364,378,391,404,416,433,445],"tbody",{},[305,325,326,332,335],{},[327,328,329],"td",{"align":310},[51,330,331],{},"examples/minimal/build/*.cap",[327,333,334],{"align":310},"rm (intended)",[327,336,337],{"align":310},"Deleted matching files",[305,339,340,345,347],{},[327,341,342],{"align":310},[51,343,344],{},"examples/minimal/build/*.jca",[327,346,334],{"align":310},[327,348,337],{"align":310},[305,350,351,356,361],{},[327,352,353],{"align":310},[51,354,355],{},"uv",[327,357,358,360],{"align":310},[51,359,292],{}," command",[327,362,363],{"align":310},"Tried to delete (didn’t exist)",[305,365,366,371,376],{},[327,367,368],{"align":310},[51,369,370],{},"run",[327,372,373,375],{"align":310},[51,374,292],{}," argument",[327,377,363],{"align":310},[305,379,380,385,389],{},[327,381,382],{"align":310},[51,383,384],{},"python",[327,386,387,375],{"align":310},[51,388,292],{},[327,390,363],{"align":310},[305,392,393,398,401],{},[327,394,395],{"align":310},[51,396,397],{},"-m",[327,399,400],{"align":310},"python flag",[327,402,403],{"align":310},"Ignored by rm (not a valid rm flag)",[305,405,406,411,414],{},[327,407,408],{"align":310},[51,409,410],{},"backend3",[327,412,413],{"align":310},"python module name",[327,415,363],{"align":310},[305,417,418,425,428],{},[327,419,420],{"align":310},[249,421,422],{},[51,423,424],{},"examples/minimal",[327,426,427],{"align":310},"build target path",[327,429,430],{"align":310},[249,431,432],{},"Deleted the minimal example",[305,434,435,440,443],{},[327,436,437],{"align":310},[51,438,439],{},"--jcc-root",[327,441,442],{"align":310},"build flag",[327,444,363],{"align":310},[305,446,447,453,456],{},[327,448,449],{"align":310},[249,450,451],{},[51,452,47],{},[327,454,455],{"align":310},"current directory",[327,457,458],{"align":310},"Tried to delete (disallowed by rm)",[37,460,461,462,464,465,468,469,471],{},"The ",[51,463,288],{}," on the first line and ",[51,466,467],{},"2>&1"," on the second became redirects on the merged command, with the last one winning. That’s why the ",[51,470,47],{}," error appeared in stdout rather than stderr:",[73,473,476],{"className":474,"code":475,"language":140},[138],"rm: \".\" and \"..\" may not be removed\n",[51,477,475],{"__ignoreMap":79},[37,479,480,481,484,485,487,488,490,491,494,495,497,498,500,501,503,504,507,508,510],{},"That error only shows up when ",[51,482,483],{},"rm"," receives ",[51,486,47],{}," as an argument. The ",[51,489,47],{}," came from ",[51,492,493],{},"--jcc-root ."," - never supposed to be an argument to ",[51,496,483],{},", and hence why we see the error. However, while ",[51,499,296],{}," skips ",[51,502,47],{}," and ",[51,505,506],{},"..",", it still processes every other argument. The project root survived only because ",[51,509,47],{}," is protected.",[37,512,513],{},"But this is a story about my entire project being deleted. So, what happened?",[37,515,516],{},"I’ve been lying to you.",[37,518,519,520,523,524,526],{},"Initially, I thought the command I showed you was the one that deleted my project. In reality, it only deleted ",[51,521,522],{},"examples/minimal/",". That was enough to confuse Claude, though. It started running other commands to try to figure out why it couldn’t find ",[51,525,522],{},". The next command it generated used absolute paths instead of relative ones:",[73,528,531],{"className":529,"code":530,"language":78,"meta":79},[76],"rm -rf /Users/trey/Documents/Projects/backend3/examples/correctness/build/*.cap /Users/trey/Documents/Projects/backend3/examples/correctness/build/*.jca 2>/dev/null\nuv run python -m backend3 /Users/trey/Documents/Projects/backend3/examples/correctness --jcc-root /Users/trey/Documents/Projects/backend3 2>&1 | tail -3\n",[51,532,530],{"__ignoreMap":79},[37,534,535,536,538,539,297],{},"And now, look at what ",[51,537,296],{}," receives from ",[51,540,439],{},[37,542,543],{},[51,544,545],{},"/Users/trey/Documents/Projects/backend3",[37,547,548,549,551,552,554],{},"That’s not ",[51,550,47],{}," - it’s the absolute path to the project root. ",[51,553,483],{}," has no problem deleting that.",[37,556,557],{},"The response was empty. Every command after that returned exit code 1 with no output - the working directory no longer existed.",[37,559,21],{},[37,561,562],{},"This bug remains open as of version 2.1.41. The timeline:",[564,565,566,587,622,631,660,670],"ul",{},[567,568,569,252,572,577,578,580,581,583,584,586],"li",{},[249,570,571],{},"April 2025",[41,573,576],{"href":574,"rel":575},"https://github.com/anthropics/claude-code/issues/774",[45],"#774",", v0.2.69): Pipes are completely broken. Commands with ",[51,579,246],{}," error out or produce garbage. Multi-line commands like mine would have failed harmlessly - ",[51,582,483],{}," runs on just the build artifacts, ",[51,585,292],{}," fails in some confusing way, project survives.",[567,588,589,252,592,597,598,597,603,597,608,613,614,617,618,621],{},[249,590,591],{},"May-July 2025",[41,593,596],{"href":594,"rel":595},"https://github.com/anthropics/claude-code/issues/1132",[45],"#1132",", ",[41,599,602],{"href":600,"rel":601},"https://github.com/anthropics/claude-code/issues/2383",[45],"#2383",[41,604,607],{"href":605,"rel":606},"https://github.com/anthropics/claude-code/issues/2851",[45],"#2851",[41,609,612],{"href":610,"rel":611},"https://github.com/anthropics/claude-code/issues/2859",[45],"#2859","): Multiple reports identify the root cause - the ",[51,615,616],{},"eval \"...\" \u003C /dev/null"," wrapper and how ",[51,619,620],{},"\u003C /dev/null"," interacts with pipes.",[567,623,624,627,628,630],{},[249,625,626],{},"~Mid-2025"," (1.0.x): A fix ships that makes single-line pipes work by adding preprocessing logic to detect ",[51,629,246],{}," and handle it specially. This fix also collapses newlines to spaces when a pipe is present. This is when my specific command becomes destructive.",[567,632,633,252,636,597,641,597,646,597,651,656,657,659],{},[249,634,635],{},"August-December 2025",[41,637,640],{"href":638,"rel":639},"https://github.com/anthropics/claude-code/issues/7255",[45],"#7255",[41,642,645],{"href":643,"rel":644},"https://github.com/anthropics/claude-code/issues/10077",[45],"#10077",[41,647,650],{"href":648,"rel":649},"https://github.com/anthropics/claude-code/issues/12637",[45],"#12637",[41,652,655],{"href":653,"rel":654},"https://github.com/anthropics/claude-code/issues/15951",[45],"#15951","): Users keep losing data to ",[51,658,296],{}," commands corrupted by the same parsing logic.",[567,661,662,252,665,669],{},[249,663,664],{},"December 28, 2025",[41,666,668],{"href":255,"rel":667},[45],"#15599","): The multi-line + pipe corruption is filed with clear reproduction steps.",[567,671,672,675],{},[249,673,674],{},"February 4, 2026",": My project gets deleted. Bug still open.",[677,678,679],"blockquote",{},[37,680,681,684,685,688],{},[249,682,683],{},"Update (April 30, 2026):"," ",[41,686,668],{"href":255,"rel":687},[45]," has since been closed as not planned.",[212,690,692],{"id":691},"back-to-a-strange-error","Back to a strange error",[37,694,695,696,698,699,702,703,706],{},"Rewind a bit for a moment - I’m in ",[51,697,121],{}," recovering files, and I ",[51,700,701],{},"cd"," into the project directory Claude Code had been tracking. Claude Code mirrors your project’s absolute path under ",[51,704,705],{},"~/.claude/projects/",", replacing slashes with dashes:",[73,708,711],{"className":709,"code":710,"language":140},[138],"❯ cd ~/.claude/projects/-Users-trey-Documents-Projects-backend3/\nstring escape: -Users-trey-Documents-Projects-backend3: unknown option\n\n~/.config/fish/functions/_tide_parent_dirs.fish (line 1):\nstring escape (\n^\nin command substitution\n    called on line 2 of file ~/.config/fish/functions/_tide_parent_dirs.fish\nin function '_tide_parent_dirs' with arguments 'VARIABLE SET PWD'\n    called on line 1 of file embedded:functions/cd.fish\n\n(Type 'help string' for related documentation)\n\n❯\n",[51,712,710],{"__ignoreMap":79},[37,714,715,716,719,720,723,724,47],{},"Weird to have that from just entering a directory. ",[61,717,718],{},"Unknown option?"," The directory name is a bit odd, starting with a dash. That’s what Claude Code uses instead of ",[51,721,722],{},"/"," in a project path. But the error wasn’t anything related to Claude Code, it was coming from my shell, fish. More specifically, it’s coming from the prompt I use - ",[41,725,728],{"href":726,"rel":727},"https://github.com/IlanCosman/tide",[45],"Tide",[37,730,731,732,735],{},"Tide calls ",[51,733,734],{},"string escape"," on directory path components, and this directory name starts with a dash. Meaning: the directory name is being parsed as a command-line flag. That’s options injection - when untrusted data is interpreted as a flag to a command instead of as an operand.",[37,737,738],{},"Here’s the vulnerable line:",[73,740,743],{"className":741,"code":742,"language":140},[138],"# _tide_parent_dirs.fish:2\nset -g _tide_parent_dirs (string escape (for dir in ...))\n",[51,744,742],{"__ignoreMap":79},[37,746,747,753,754,757,758,761],{},[41,748,751],{"href":749,"rel":750},"https://fishshell.com/docs/current/cmds/string-escape.html",[45],[51,752,734],{}," is Fish’s built-in for quoting strings so they’re safe to pass through the shell. It has a ",[51,755,756],{},"--style"," flag that controls its escaping strategy, allowing you to safely escape text for different contexts like regex patterns or shell scripts. The bug is simple - it’s called here on path components without a ",[51,759,760],{},"--"," separator, so a path component that looks like a flag gets parsed as one.",[37,763,764,766,767,770,771,774,775,777,778,780],{},[51,765,734],{}," defaults to ",[51,768,769],{},"script"," mode, which quotes shell metacharacters like semicolons. But ",[51,772,773],{},"--style=regex"," switches it to only escape regex-special characters, leaving semicolons raw. And because there’s no ",[51,776,760],{}," separator in Tide’s call, a path component starting with ",[51,779,773],{}," gets parsed as a flag.",[37,782,783,784,786],{},"The question is: how do we get ",[51,785,773],{}," as a standalone argument when it’s embedded in a directory path? We just need to know two things:",[788,789,790,797],"ol",{},[567,791,792,793,796],{},"Directory names can contain literal newline characters - ",[51,794,795],{},"0x0a"," bytes.",[567,798,461,799,802],{},[51,800,801],{},"(for dir in ... end)"," call is a command substitution, and Fish splits command substitution output on newlines. So, a directory named:",[73,804,807],{"className":805,"code":806,"language":140},[138],"foo\n--style=regex\n;touch PWNED;#\n",[51,808,806],{"__ignoreMap":79},[37,810,811],{},"Gets split into three separate arguments:",[788,813,814,819,824],{},[567,815,816],{},[51,817,818],{},"foo",[567,820,821,823],{},[51,822,773],{}," - parsed as a flag",[567,825,826,829],{},[51,827,828],{},";touch PWNED;#"," - escaped in regex mode, which doesn’t touch semicolons",[37,831,832,833,836,837,840,841,844],{},"That third argument, now carrying a raw semicolon, gets stored in the global variable ",[51,834,835],{},"_tide_parent_dirs",". When Tide renders the prompt, it passes this into a ",[51,838,839],{},"fish -c"," subprocess. The semicolon terminates the intended command, and ",[51,842,843],{},"touch PWNED"," executes as a separate statement.",[37,846,847,848,47],{},"Arbitrary command execution triggered by ",[51,849,701],{},[37,851,852,853,855],{},"The most plausible attack path: victim clones a malicious repo, extracts an untrusted archive, or checks out a repo created elsewhere, and ",[51,854,701],{},"s into it.",[32,857,859],{"id":858},"what-about-other-prompts","What about other prompts?",[37,861,862,863,868,869,872,873,597,876,597,879,882],{},"The idea that the filesystem is an injection surface isn’t new. In 2014, Leon Juranic published ",[41,864,867],{"href":865,"rel":866},"https://www.exploit-db.com/papers/33930",[45],"“Unix Wildcards Gone Wild”",", showing that filenames like ",[51,870,871],{},"--checkpoint-action=exec=sh shell.sh"," get expanded by shell globs into command-line arguments for ",[51,874,875],{},"tar",[51,877,878],{},"rsync",[51,880,881],{},"chown",". The shell does the glob before the program sees it, so the program can’t distinguish a real flag from a malicious filename.",[37,884,885,886,888],{},"Shell prompt frameworks are a constantly-running version of this. They execute on every prompt render, pulling in directory names, git branch names, version strings, and interpolating them into shell commands, eval strings, interpreter invocations. All an attacker needs is for you to ",[51,887,701],{}," into the wrong directory.",[37,890,891],{},"If Tide is interpolating unsanitized path data into commands, others probably are too.",[37,893,894],{},"We shook this tree a bit more and 3 more bugs fell out.",[212,896,898,899,902],{"id":897},"prezto-zsh-e-eval-injection-via-git-branch-name","Prezto (Zsh) - ",[51,900,901],{},"${(e)...}"," eval injection via git branch name",[37,904,905,906,908,909,912,913,916,917,297],{},"Several Prezto themes (paradox, cloud, skwp, damoekri) use zsh’s ",[51,907,901],{}," parameter expansion flag on ",[51,910,911],{},"git_info"," values that include the branch name. In zsh, the ",[51,914,915],{},"(e)"," flag performs shell expansion on the string’s contents - including command substitution. The branch name is stored in ",[51,918,919],{},"git_info[ref]",[73,921,924],{"className":922,"code":923,"language":140},[138],"# prompt_paradox_setup:53\nprompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}'\n",[51,925,923],{"__ignoreMap":79},[37,927,928,929,932,933,936,937,942,943,597,946,949,950,953,954,957],{},"A branch named ",[51,930,931],{},"$(cmd)"," runs ",[51,934,935],{},"cmd"," every time the prompt renders. Git’s ",[41,938,941],{"href":939,"rel":940},"https://git-scm.com/docs/git-check-ref-format",[45],"refname rules"," disallow whitespace and several characters, but they allow ",[51,944,945],{},"$",[51,947,948],{},"(",", and ",[51,951,952],{},")"," - so ",[51,955,956],{},"$(id>PWNED)"," is a valid branch name.",[37,959,960,961,963],{},"You ",[51,962,701],{}," into the repo and it runs.",[212,965,967],{"id":966},"spaceship-zsh-interpreter-code-injection-via-directory-path","Spaceship (Zsh) - interpreter code injection via directory path",[37,969,970,971,974,975,978],{},"Spaceship’s version detection in ",[51,972,973],{},"extract.zsh"," interpolates ",[51,976,977],{},"$file"," - a filesystem path - directly into interpreter code strings without escaping quotes:",[73,980,983],{"className":981,"code":982,"language":140},[138],"# extract.zsh:57 (Ruby JSON path)\nruby -r json -e \"puts ['version'].map { |key|\n  key.split('.').reduce(JSON::load(File.read('$file'))) { |obj, key|\n    obj[key] } }.find(&:itself)\"\n",[51,984,982],{"__ignoreMap":79},[37,986,987,988,991,992,47],{},"A single quote in the directory name breaks out of ",[51,989,990],{},"File.read('...')",". The attacker has to close the surrounding Ruby syntax (the reduce block, map block, find call) before injecting their own code - messier than the other vulns, but straightforward to automate. Spaceship tries extractors in order - jq, yq, ruby, python3, node - so the injection depends on which interpreter is present. Triggers when you enter a directory containing ",[51,993,994],{},"package.json",[212,996,998,999,1002],{"id":997},"liquidprompt-bash-gitstatus-bypasses-__lp_escape-for-ps1","Liquidprompt (Bash) - gitstatus bypasses ",[51,1000,1001],{},"__lp_escape"," for PS1",[37,1004,1005,1006,1009],{},"When the optional gitstatus daemon is enabled, ",[51,1007,1008],{},"_lp_git_branch()"," copies the branch name straight into prompt variables without sanitization. This is a non-default configuration, but it’s exactly the kind of “fast path” optimization that gets copied into dotfiles and forgotten about:",[73,1011,1014],{"className":1012,"code":1013,"language":78,"meta":79},[76],"# Gitstatus path (vulnerable) - liquidprompt:3166\n_lp_git_branch() {\n    if (( _LP_GITSTATUS_DATA )); then\n        lp_vcs_branch=\"${VCS_STATUS_LOCAL_BRANCH-}\"  # NO __lp_escape!\n        [[ -n \"$lp_vcs_branch\" ]] && return || return 1\n    fi\n    # ...\n    # Normal path (safe) - liquidprompt:3175\n    __lp_escape \"${branch#refs/heads/}\"\n    lp_vcs_branch=\"$ret\"\n",[51,1015,1013],{"__ignoreMap":79},[37,1017,1018,1021,1022,1024,1025,1028,1029,1031],{},[51,1019,1020],{},"__lp_escape()"," exists to escape ",[51,1023,945],{}," and backticks before they hit PS1. Every other VCS backend in Liquidprompt calls it - Mercurial, SVN, Fossil, Bazaar. The gitstatus fast path doesn’t. Bash’s ",[51,1026,1027],{},"promptvars"," option (on by default) evaluates ",[51,1030,931],{}," in the branch name. Same mechanism as Prezto.",[212,1033,1035],{"id":1034},"postmortem","Postmortem",[37,1037,1038,1039,1041],{},"We successfully demonstrated PoCs for all four bugs, each triggering command injection after a ",[51,1040,701],{}," to a bad directory.",[37,1043,1044],{},"Disclosure status as of publication:",[564,1046,1047,1062,1073,1084],{},[567,1048,1049,1051,1052,1056,1057,47],{},[249,1050,728],{},": upstream ",[41,1053,1055],{"href":726,"rel":1054},[45],"IlanCosman/tide"," is no longer maintained and remains vulnerable. Fixed in the maintained fork: ",[41,1058,1061],{"href":1059,"rel":1060},"https://github.com/plttn/tide/releases/tag/v7.0.15",[45],"plttn/tide v7.0.15",[567,1063,1064,1067,1068,47],{},[249,1065,1066],{},"Prezto",": fixed upstream: ",[41,1069,1072],{"href":1070,"rel":1071},"https://github.com/sorin-ionescu/prezto/commit/5464030f6a7c7c1a0bfc376a094f2c2794d85b1d",[45],"5464030",[567,1074,1075,1067,1078,1083],{},[249,1076,1077],{},"Spaceship",[41,1079,1082],{"href":1080,"rel":1081},"https://github.com/spaceship-prompt/spaceship-prompt/pull/1541",[45],"PR #1541"," (v4.22.1).",[567,1085,1086,1067,1089,1094,1095,1100,1101,47],{},[249,1087,1088],{},"Liquidprompt",[41,1090,1093],{"href":1091,"rel":1092},"https://github.com/nojhan/liquidprompt/commit/a4f6b8d8c90b3eaa33d13dfd1093062ab9c4b30c",[45],"a4f6b8d",". Tracked as ",[41,1096,1099],{"href":1097,"rel":1098},"https://nvd.nist.gov/vuln/detail/CVE-2026-27113",[45],"CVE-2026-27113"," / ",[41,1102,1105],{"href":1103,"rel":1104},"https://github.com/nojhan/liquidprompt/security/advisories/GHSA-q6hm-vf4f-47jf",[45],"GHSA-q6hm-vf4f-47jf",[32,1107,1109],{"id":1108},"conclusion","Conclusion",[37,1111,1112],{},"Started with a fun side project. Ended with a deleted codebase, a recovery tool, a confirmed bug in Claude Code, and command injection in four shell prompt frameworks.",[37,1114,1115],{},"Push your commits. Don’t approve multi-line pipes in Claude Code. And take a closer look at what your shell prompt is doing every time you press Enter.",[37,1117,1118],{},"Or don’t. You might find some 0-days.",{"title":79,"searchDepth":1120,"depth":1120,"links":1121},2,[1122,1123,1124,1125,1127,1128,1132,1135,1143],{"id":34,"depth":1120,"text":35},{"id":67,"depth":1120,"text":68},{"id":103,"depth":1120,"text":104},{"id":125,"depth":1120,"text":1126},"A journey through ~/.claude",{"id":173,"depth":1120,"text":174},{"id":191,"depth":1120,"text":192,"children":1129},[1130],{"id":214,"depth":1131,"text":215},3,{"id":281,"depth":1120,"text":282,"children":1133},[1134],{"id":691,"depth":1131,"text":692},{"id":858,"depth":1120,"text":859,"children":1136},[1137,1139,1140,1142],{"id":897,"depth":1131,"text":1138},"Prezto (Zsh) - ${(e)...} eval injection via git branch name",{"id":966,"depth":1131,"text":967},{"id":997,"depth":1131,"text":1141},"Liquidprompt (Bash) - gitstatus bypasses __lp_escape for PS1",{"id":1034,"depth":1131,"text":1035},{"id":1108,"depth":1120,"text":1109},{"topics":1145,"header":1150,"labels":1155,"summary":1160,"article":1163,"contact":1177,"footer":1180},[1146,1147,14,1148,13,1149],"Hardware","Firmware","Regulation","About us",{"menu":1151,"talk":1152,"back":1153,"home":1154},"Menu","Let’s Talk","Back to the climb","Blog home",{"by":1156,"and":1157,"minutesRead":1158,"minutes":1159},"By","and","min read","min",{"label":1161,"regionLabel":1162},"For leaders · 30 seconds","Summary for leaders",{"titleTemplate":1164,"back":1165,"ctaLabel":1166,"engineers":1167,"leaders":1170,"keepReading":1176},"%s | Crystal Peak Security","All field notes","Next steps",{"label":1168,"button":1169},"For your engineers","Book a technical call",{"person":1171,"photoAlt":1172,"label":1173,"text":1174,"button":1175},"anthony","Anthony DeLorenzo","For leaders","Rather start with a conversation? You’ll talk to Anthony first.","Let’s talk","Keep reading",{"email":1178,"phone":1179},"letstalk@crystalpeaksecurity.com","+1.919.230.1611",{"copyright":1181,"links":1182},"© 2026 Crystal Peak Security · Raleigh, NC",[1183,1186],{"label":1184,"social":1185},"LinkedIn","linkedin",{"label":1187,"social":1188},"Reddit","reddit",[1190,1194],{"stem":1191,"name":1172,"role":1192,"photo":1193},"authors/anthony","founder","/blog/anthony.avif",{"stem":1195,"name":1196,"role":1197,"photo":1198},"authors/trey","Trey Keown","Principal Security Researcher","/blog/trey.avif",[1200,1207,1214],{"path":1201,"title":1202,"subHeading":1203,"date":1204,"icon":1205,"readingTime":1206},"/blog/device-security-in-the-world-of-ai","For Decades, Skipping Device Security Was a Plausible Business Decision","In the world of AI, it’s a major liability.","2026-10-20","sparkle",9,{"path":1208,"title":1209,"subHeading":1210,"date":1211,"icon":1212,"readingTime":1213},"/blog/how-to-tell-if-your-security-vendor-actually-looked-at-your-system","How to Tell If Your Security Vendor Actually Looked At Your System","Most security assessments cover the front door. Here’s what it looks like when someone actually checks the windows.","2026-01-30","chip",7,{"path":1215,"title":1216,"subHeading":1217,"date":1218,"icon":1219,"readingTime":1131},"/blog/staying-small-on-purpose","Staying Small on Purpose","And why that might be exactly what you’re looking for.","2026-01-19","mountain",{"bug-prices":1221},{"stem":1222,"title":1223,"scale":1224,"min":1225,"bands":1226,"rows":1239},"figures/bug-prices","What a bug was worth","log",1000,[1227,1230,1233,1236],{"label":1228,"to":1229},"Thousands",10000,{"label":1231,"to":1232},"Tens of thousands",100000,{"label":1234,"to":1235},"Hundreds of thousands",1000000,{"label":1237,"to":1238},"Millions",10000000,[1240,1246,1249,1253,1258],{"kicker":1241,"label":1242,"value":1243,"from":1244,"at":1245},"Crowdfense price list · 2024","iPhone","$5 to $7 million",5000000,7000000,{"kicker":1241,"label":1247,"value":1248,"at":1244},"Android phone","Up to $5 million",{"kicker":1241,"label":1250,"value":1251,"at":1252},"Chrome browser","Up to $3 million",3000000,{"kicker":1254,"label":1255,"value":1256,"at":1257},"Pwn2Own contest prize · 2022","iPhone 13","$200,000",200000,{"kicker":1254,"label":1259,"value":1260,"at":1261,"accent":1262},"Home router","$20,000",20000,true,1796060876102]