2026-11-26 15:48 UTC

ZCode: reported repository snapshot uploads, followed by remediation claims

state: corroboratedheat: highuncertainty: mediumrelevance: highcoding-agents developer-tool-security repository-data-exfiltrationferstarZhipuZ.ai

What is this?

In September 2026, researcher ferstar reported reverse-engineering Zhipu/Z.ai’s ZCode coding app and finding that it packaged workspace snapshots—including Git data—and attempted encrypted uploads to Alibaba Cloud. The researcher said the uploads continued with training and indexing settings disabled. Z.ai later apologized, said it had disabled the snapshot-upload workflow and retained or used no such data for training, and announced that ZCode was open-sourced; it cited security assessments, whose full reports were still forthcoming in the supplied sources.

Why it matters

This is a consequential trust and security issue for AI coding tools: ferstar’s reverse-engineering account describes ZCode uploading workspace snapshots that could include Git objects, LFS assets and configuration—not just task-selected code context—with settings that reportedly did not stop capture or upload. Z.ai later said the workflow was disabled, relevant data was not retained or used for training, and published the code with security assessments underway. That response is material, but the supplied sources do not independently verify all affected versions, the extent of completed uploads, or the assessment findings. For users choosing coding agents, the incident highlights why data scope, opt-outs and auditable production builds matter alongside model quality.

Current assessment

On 18 September 2026, researcher ferstar published a reverse-engineering report alleging that logged-in ZCode clients created encrypted workspace snapshots and attempted to upload them directly to Alibaba Cloud OSS. Ferstar reported finding a 313 MB pending archive and a plaintext manifest indicating that Git LFS data, Git objects and reflogs made up most of a sampled payload; the report also describes global app configuration being included. The researcher said capture and upload continued with training and repository-indexing settings disabled, and argued that the encryption key arrangement gave the server access. These are findings and interpretations from one researcher’s analysis, not independently established facts in the supplied evidence. Reddit reposts include a Z.ai statement acknowledging an issue tied to Codebase Indexing/Repo Wiki, apologizing, saying the feature was enabled by default for some early users, and reporting that the issue was fixed. A later announcement, reproduced in a Reddit post, says ZCode was open-sourced, the snapshot-upload workflow and Repo Wiki feature were removed in v3.14.0, the OSS bucket and its objects were deleted, and CAICT and NSFOCUS found no remaining snapshot-generation or local-file transmission path; Z.ai also said data was not retained or used for model training and that full assessment reports would follow. These are company claims as relayed by the post, not the underlying audit reports. A 26 September Hacker News post raises a question about whether the published source matches the production client, but supplies no verification. The new evidence therefore shifts the case from an unresolved allegation toward reported remediation and disclosure, while leaving independent confirmation, historical exposure and production/source parity open. Practical implication: developers handling sensitive repositories should verify the client version and data-handling behavior rather than infer safety from privacy toggles or source publication alone.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady3 platformsage 1681h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

09-17 14:00⭐ origin echo-reconstructedReports finding pending encrypted workspace archives, manifests containing Git objects, LFS caches and reflogs, and a reverse-engineered Ali
ferstar on blog (echo) · attributed from hn.story.49750694
—
09-18 06:11first on hacker news · published · +16.2hInside ZCode: Silently Uploading Your Git History to the Cloud
csmantle
—
09-18 07:49first on r/LocalLLaMA · published · +17.8hZCode was allegedly caught uploading workspace/.git records to the cloud.
External_Mood4719
—
09-18 06:11amplified on hacker news 👑hn.story.49750694
csmantle
peak 342 · 111 comments · 33% of case engagement
09-18 07:49amplified on r/LocalLLaMAreddit.post.1wjjspd
External_Mood4719
peak 267 · 87 comments · 15% of case engagement
09-18 10:35amplified on hacker newshn.story.49752422
cdnsteve
peak 262 · 63 comments · 24% of case engagement
09-21 00:01amplified on hacker newshn.story.49781458
fourfire
peak 5 · 0 comments · 0% of case engagement
09-21 02:09amplified on r/LocalLLaMAreddit.post.1wlzvcx
ResearchCrafty1804
peak 564 · 118 comments · 28% of case engagement
09-21 02:37amplified on hacker newshn.story.49782440
linzhangrun
peak 5 · 0 comments · 0% of case engagement
1 more amplifiers in ainews.case_chain
09-18 06:20our radar first saw it · +16.3hdiscovery anchor: hn.story.49750694—
09-19 08:26reached heat=high · +42.4h · via ledger——

Evidence (8) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnInside ZCode: Silently Uploading Your Git History to the Cloud
Retrieved article excerpt

Open article · Retrieved 2026-09-18T06:21:21.316562+00:00

1. [Code is cheap, let's talk](https://blog.ferstar.org/en/)/
2. [Archive](https://blog.ferstar.org/en/posts/)/
3. [Inside ZCode: Silently Uploading Your Entire Git History to the Cloud](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/)/

# Inside ZCode: Silently Uploading Your Entire Git History to the Cloud

Sep 18, 2026·7 mins·


·






·
[#Security](https://blog.ferstar.org/en/tags/security/)
[#Privacy](https://blog.ferstar.org/en/tags/privacy/)
[#AI Coding](https://blog.ferstar.org/en/tags/ai-coding/)
[#Reverse Engineering](https://blog.ferstar.org/en/tags/reverse-engineering/)

Copy Markdown

Table of Contents


Table of Contents

> I am not a native English speaker; this article was translated by AI.

It started with a routine check while freeing up disk space: `~/.zcode` was taking up over 700MB. After digging into it intermittently, I confirmed something pretty wild:

**Whenever you are logged in, ZCode (Zhipu’s official AI coding desktop app) silently packages your entire workspace — complete `.git` history, LFS asset cache, reflogs, and global app configs — encrypts it, and uploads it directly to Aliyun OSS.**

Even more ironic: **the RSA public key used for encryption is delivered on the fly by the server, while the private key lives exclusively in the cloud.** You cannot decrypt that multi-hundred-megabyte ciphertext sitting right on your own disk, and neither can the ZCode client itself.

Here is the complete record of the investigation, the evidence chain, and a one-liner defense that permanently shuts it down.

## The Starting Point: A 313MB Archive Stuck in Pending [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#the-starting-point-a-313mb-archive-stuck-in-pending)

`~/.zcode` is the data root of ZCode. The size breakdown looked roughly like this:

- `cli/`: ~257MB (session databases, execution logs)
- `computer-use/`: ~130MB (bundled app and runtime dependencies)
- `v2/checkpoints/`: ~303MB (the main suspect)

Inside `v2/checkpoints/`, I found a 313MB `.enc` file alongside a state metadata file:

```
{
  "workspacePath": "/Users/ferstar/myprojects/<a commercial project>",
  "lastCompressedSize": {
    "encryptedSizeBytes": 313070842,
    "workspaceSizeBytes": 345549173
  },
  "kind": "baseline",
  "failureCount": 564
}
```

The story was straightforward:

1. The client scanned my active commercial project, excluded `node_modules` and a few others, and packaged the remaining 345MB into a 313MB encrypted archive labeled `baseline` (full snapshot);
2. It recorded 564 failed upload attempts, leaving it sitting in the local `pending/` directory waiting for the next retry.

The repository totaled 10GB; minus dependencies, the remaining 345MB was almost entirely core intellectual property.

## Where It Goes: From Logs to asar Reverse Engineering [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#where-it-goes-from-logs-to-asar-reverse-engineering)

The logs contained no explicit upload URLs, so I cracked open the client’s `app.asar`. The reconstructed upload flow:

```
sequenceDiagram
    participant C as ZCode client
    participant S as zcode.z.ai
    participant O as Aliyun OSS
    C->>S: POST /api/v1/snapshot/upload-credential
    S-->>C: snapshot_id + RSA public key + max_size + OSS form credentials + callback
    C->>C: tar.gz pack → AES-256-CTR encrypt → RSA-OAEP wrap key
    C->>O: PostObject direct upload of tar.gz.enc
    O->>S: callback confirms receipt
```

The pipeline runs in two stages:

1. **Request credentials from coordinator**: The client calls `https://zcode.z.ai` (`VITE_ZCODE_ENDPOINT_ORIGIN` in code). The server returns OSS form signatures (`policy`, `x-oss-signature`), a dynamic Object Key, size limits, and the RSA public key for this encryption round;
2. **Direct form POST to OSS**: After archiving and streaming encryption locally, the client **bypasses ZCode’s own application servers and posts `tar.gz.enc` directly to Aliyun OSS via an HTTP POST form**. OSS then calls back to Zhipu’s backend to register the snapshot.

Inspecting active sockets confirmed this: the running ZCode process maintained persistent HTTPS connections to `zcode.z.ai` IP endpoints plus two Aliyun OSS storage nodes.

## The Most Ironic Part: The Key Belongs to the Server [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#the-most-ironic-part-the-key-belongs-to-the-server)

The encryption implementation uses textbook envelope encryption:

```
keyId: String(i.encryption.key_version),
keyWrapAlgorithm: "rsa-oaep-sha256",
publicKeySpkiPem: Ylt(i.encryption.public_key)
```

- Content is encrypted using an ephemeral symmetric key via AES-256-CTR;
- The symmetric key is wrapped using RSA-OAEP-SHA256 with the public key supplied by the server.

The critical catch is that public key: **it is handed down by the server during credential negotiation, and the corresponding private key never touches your machine.** Unwrapping the envelope key with all local private keys on my system failed, as expected.

In other words: that 313MB ciphertext on your drive cannot be opened by you or the client. Only Zhipu’s backend holds the key to unlock it.

If this feature were genuinely built for user-facing rollback or cross-device sync, the keys would live locally (just like Git or Time Machine). **A key that only the server can use serves exactly one purpose: making sure the server can read your code whenever it wants.**

## What Gets Packed: Nearly 90% Is .git [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#what-gets-packed-nearly-90-is-git)

Even though the ciphertext is locked, the Manifest (file inventory) generated during packaging is saved locally in plaintext. Breaking down a snapshot of 42,411 files:

| Content | Size | Proportion | Information Contained |
| --- | --- | --- | --- |
| `.git/lfs/` | 196.1 MB | 56.8% | LFS cache — all binary assets and large media ever downloaded |
| `.git/objects/` | 102.2 MB | 29.6% | Complete commit history object store (commits, trees, blobs) |
| `.git/logs/` | 0.6 MB | 0.2% | reflogs — local branch history and unpushed operational traces |
| Source code & docs | ~46.2 MB | 13.4% | `src/`, config files, internal documentation |

The `.git` directory alone accounts for **86.6%** of the payload.

Once uploaded, the cloud receives far more than your current working tree — it gets **the entire lineage of your repository since day one**:

- Historical API keys and sensitive configs that were deleted in later commits;
- Unpushed local branch names (which reveal unreleased feature plans);
- Internal GitLab hostnames and repository paths configured in `.git/config`.

Furthermore, an extra manifest named `repo_snapshot_extra_manifest` hashes your global ZCode configuration files (such as `settings.behavior.json`) and bundles them across workspaces with every snapshot.

## The Truth About the Switches: UI Toggles Don’t Stop It [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#the-truth-about-the-switches-ui-toggles-dont-stop-it)

The natural reaction is checking settings to toggle it off. I cross-referenced the UI options with the codebase:

| Switch | What you expect it to do | What it actually does |
| --- | --- | --- |
| **Optimize Experience** (`optimizeAgentExperienceEnabled`) | Disables telemetry / data collection | **Only controls whether data is authorized for model training**. Snapshot capture and upload still run |
| **Repo Snapshot Indexing** (`repoSnapshotIndexingEnabled`) | Disables the snapshot feature | **Only controls whether the server indexes uploaded snapshots**. Local packaging and upload continue uninterrupted |

Looking at host assembly code makes it crystal clear: the capture/upload sidecar is **instantiated unconditionally** at startup. There are no gating `if` checks on user preferences; the only requirement is that `tokenProvider` can return a valid JWT.

**Bottom line: as long as you are logged in, this background pipeline is permanently active, and no UI setting can turn it off.**

Capture triggers occur at two points: `captureBeforePrompt` (before every prompt) and on task completion tagged with `repo-wiki-update`. In session logs, a single active session generated up to 62 capture events.

## What the Privacy Policy Says [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#what-the-privacy-policy-says)

Checking ZCode’s privacy policy, it explicitly states that it collects “text, files, and code submitted during conversations” — standard practice for feeding context to LLMs.

However, across the entire policy, FAQs, and changelogs, there is **not a single mention of silently packaging and uploading entire workspaces and full Git histories**.

The closest mention is the generic template statement: “optimization program is off by default, and inputs will not be used for training without consent”.

## Defense: Deleting Is Whack-a-Mole; Lock the Directory [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#defense-deleting-is-whack-a-mole-lock-the-directory)

When I first found the pending package, I simply deleted it. Within half an hour, it re-captured — a fresh 313MB archive with the retry counter ticking from 564 to 565. When the uploader sees the file is gone, it just packs a new one. Manual deletion is whack-a-mole.

The cleanest and most effective solution is setting an immutability flag at the filesystem level, denying write access at the kernel level:

### macOS [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#macos)

```
# Wipe and lock the checkpoints directory
rm -rf ~/.zcode/v2/checkpoints
mkdir -p ~/.zcode/v2/checkpoints
chflags uchg ~/.zcode/v2/checkpoints

# Verify: should output "Operation not permitted"
touch ~/.zcode/v2/checkpoints/test
```

### Linux [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#linux)

```
# Wipe and lock the checkpoints directory
rm -rf ~/.zcode/v2/checkpoints
mkdir -p ~/.zcode/v2/checkpoints
sudo chattr +i ~/.zcode/v2/checkpoints

# Verify: should output "Operation not permitted"
touch ~/.zcode/v2/checkpoints/test
```

### Impact & Rollback [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#impact--rollback)

- **Result**: The capture logic gets blocked by the kernel whenever it attempts disk I/O. Without local artifacts, the upload pipeline has nothing to send;
- **Trade-off**: The “checkpoint rollback / timeline” UI feature won’t work (which always required uploading your code in the first place). Normal chat, autocomplete, and tool executions work without issue. Swallowed I/O errors in logs are harmless;
- **To restore**: Run `chflags nouchg ~/.zcode/v2/checkpoints` (macOS) or `sudo chattr -i ~/.zcode/v2/checkpoints` (Linux).

## Closing Thoughts [#](https://blog.ferstar.org/en/posts/zcode-silent-workspace-snapshot-upload/#closing-thoughts)

When using AI tools, model inference inevitably needs code context — everyone accepts that going in. But this behavior clearly crosses the line in two ways:

First, **data scope**. Inference sends task-relevant context; snapshotting exfiltrates the entire repository along with years of Git commit history.

Second, **architectural posture**. If this were genuinely designed for user-side restore or syncing, the decryption keys would belong to the user. An encryption key held exclusively by the server, zero disclosure in privacy policies, unstoppable background uploads, and stubborn re-packaging upon deletion — this looks less like backup and far more like collection.

Tools are tools, but users must draw their own boundaries. If the software won’t let you turn it off, use the OS kernel to lock it in a cage.

## Related

[## 1Password Raised Its Price Again, So I Moved to Self-Hosted Vaultwarden](https://blog.ferstar.org/en/posts/1password-to-self-hosted
csmantle342111
🟧 echo.blog ⭐Reports finding pending encrypted workspace archives, manifests containing Git objects, LFS caches and reflogs, and a reverse-engineered Aliferstar——
🟠 redditZCode was allegedly caught uploading workspace/.git records to the cloud.
LocalLLaMA
External_Mood471926787
🟧 hnZCode, the GLM coding agent, silently uploads your Git historycdnsteve26214
🟧 hnZCode: silently uploading your Git history to the cloudfourfire50
🟠 redditZCode is now open source
LocalLLaMA
ResearchCrafty1804559116
🟧 hnZCode, embroiled in a controversy over stealing user code, is now open sourcelinzhangrun50
🟧 hnIs z.ai shipping a different ZCode client than the source?leftbehind30

Interpretation history

Decision trace