告诉HN:Claude Code 现在允许Anthropic远程注入系统提示。

6作者: matheusmoreira大约 6 小时前原帖
我经常会对我的Claude Code可执行文件进行系统提示的补丁,以提高Claude的有效性。每次升级时,我都会请Claude自己分析新的二进制文件,寻找需要修改的问题系统提示。今天我在升级到v2.1.150时发现了一些相当令人担忧的事情: Claude Code现在允许Anthropic通过网络进行远程系统提示注入。 有两个数据源。首先,在启动时调用api.anthropic.com/api/claude_cli/bootstrap的API,这个调用也会被缓存到磁盘。其次,是一个GrowthBook特性标志(tengu_heron_brook),每60秒刷新一次并进行后台同步。任何由这些端点返回的字符串都会被注入到具有shell访问权限的LLM模型的系统提示中。 之前的版本也有注入点,但它们是死代码,仅返回null。我进行了二分查找,发现这个问题是在v2.1.150中引入的。更新日志上写着“内部基础设施改进(没有用户可见的变化)”,这真是轻描淡写。 我已经尽我所能验证CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1可以阻止这一行为。我还将设置DISABLE_GROWTHBOOK=1以确保万无一失。 验证命令: ``` npm pack @anthropic-ai/claude-code-linux-x64@2.1.150 --pack-destination /tmp tar xzf /tmp/anthropic-ai-claude-code-linux-x64-2.1.150.tgz strings package/claude | grep -oP 'function nAA\(\)\{[^}]+\}' strings package/claude | grep -oP '.{0,60}heron_brook.{0,60}' ``` nAA从磁盘读取缓存值。网络获取发生在启动时的函数n0A中。Rv("heron_brook", () => nAA())将其注册为系统提示的一部分,与所有核心行为指令一起。这些压缩的名称是特定于这个二进制文件的。
查看原文
I often patch the system prompts on my Claude Code executable in order to make Claude more effective. Every time I upgrade, I ask Claude himself to dissect the new binary and look for problematic system prompts to modify. Was upgrading to v2.1.150 today and discovered something that&#x27;s rather alarming:<p>Claude Code now allows Anthropic to perform remote system prompt injection via the network.<p>Two data sources. First, API call to api.anthropic.com&#x2F;api&#x2F;claude_cli&#x2F;bootstrap at startup, which also gets cached to disk. Second, a GrowthBook feature flag (tengu_heron_brook) that refreshes every 60 seconds with background sync. Any string returned by these endpoints gets injected into the system prompt of the LLM model with shell access.<p>Previous versions also had an injection point, but they were dead code and simply returned null. Bisected it and found that this was introduced in v2.1.150. The changelog says &quot;Internal infrastructure improvements (no user-facing changes)&quot; which is quite the understatement.<p>I&#x27;ve verified to the best of my ability that CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 blocks this. I will also be setting DISABLE_GROWTHBOOK=1 for good measure.<p>Verification commands:<p><pre><code> npm pack @anthropic-ai&#x2F;claude-code-linux-x64@2.1.150 --pack-destination &#x2F;tmp tar xzf &#x2F;tmp&#x2F;anthropic-ai-claude-code-linux-x64-2.1.150.tgz strings package&#x2F;claude | grep -oP &#x27;function nAA\(\)\{[^}]+\}&#x27; strings package&#x2F;claude | grep -oP &#x27;.{0,60}heron_brook.{0,60}&#x27; </code></pre> nAA reads the cached value from disk. The network fetch happens at startup in function n0A. Rv(&quot;heron_brook&quot;, () =&gt; nAA()) registers it as a section of the system prompt, alongside all the core behavioral instructions. These minified names are specific to this binary.