BotBeat
...
← Back

> ▌

AnthropicAnthropic
RESEARCHAnthropic2026-03-11

Security Analysis: Claude Code Reads Environment Variables from 752 Processes, Succeeds on 256

Key Takeaways

  • ▸Claude Code scans /proc systematically on startup to inherit environment variables, but reads 752 processes instead of just the parent shell, successfully accessing 256 user-owned processes including the GNOME keyring daemon
  • ▸Reading /proc/*/environ provides attackers with addressing information (like DBUS_SESSION_BUS_ADDRESS) needed to programmatically query system keyrings for stored secrets like SSH and GPG keys
  • ▸Both Claude Code and Codex unnecessarily accessed credential files like ~/.npmrc (npm registry tokens) during tasks that didn't require them, though standard subprocess initialization was responsible for most noise
Source:
Hacker Newshttps://grith.ai/blog/syscall-trace-ai-coding-agents?march-10↗

Summary

A detailed security benchmark analysis revealed that Claude Code, Anthropic's AI coding agent, attempted to read environment variables from 752 distinct processes during a simple task of adding input validation to a single Node.js route handler—successfully accessing 256 of them. The behavior stems from Claude Code's startup mechanism, which scans /proc to inherit parent shell environment variables on Linux, but in doing so reads the environ files of every user-accessible process, including the GNOME keyring daemon that manages system secrets like SSH keys and GPG credentials. While reading /proc//environ does not directly extract stored secrets, it provides addressing information needed to query the keyring programmatically. By comparison, Codex CLI performed zero /proc//environ reads during the same task. Both agents unnecessarily read credentials like ~/.npmrc (containing npm registry tokens) and ~/.gitconfig, though this was attributed to normal subprocess initialization rather than targeted reads. The analysis was conducted under strace monitoring across two stable runs, with full benchmarking code published on GitHub.

  • Claude Code opened 2,779 unique files during the simple editing task compared to Codex's 303, raising questions about the scope and necessity of file access during routine coding operations

Editorial Opinion

This security analysis highlights a critical gap between the legitimate technical requirements of AI agents and their actual runtime behavior. While Claude Code's /proc scanning serves a genuine purpose—inheriting environment variables—the indiscriminate reading of every accessible process's environment represents an overly broad attack surface that could be exploited or refined to extract sensitive system information. The researchers' work provides a crucial reminder that AI agents operating with filesystem and process access require fine-grained permission boundaries and transparent visibility into their I/O patterns, not just trust in intended behavior.

AI AgentsCybersecurityAI Safety & AlignmentPrivacy & Data

More from Anthropic

AnthropicAnthropic
POLICY & REGULATION

Anthropic Explores AI's Role in Autonomous Weapons Policy with Pentagon Discussion

2026-04-05
AnthropicAnthropic
POLICY & REGULATION

Security Researcher Exposes Critical Infrastructure After Following Claude's Configuration Advice Without Authentication

2026-04-05
AnthropicAnthropic
POLICY & REGULATION

Anthropic's Claude Code Stores Unencrypted Session Data and Secrets in Plain Text

2026-04-04

Comments

Suggested

OracleOracle
POLICY & REGULATION

AI Agents Promise to 'Run the Business'—But Who's Liable When Things Go Wrong?

2026-04-05
AnthropicAnthropic
POLICY & REGULATION

Anthropic Explores AI's Role in Autonomous Weapons Policy with Pentagon Discussion

2026-04-05
GitHubGitHub
PRODUCT LAUNCH

GitHub Launches Squad: Open Source Multi-Agent AI Framework to Simplify Complex Workflows

2026-04-05
← Back to news
© 2026 BotBeat
AboutPrivacy PolicyTerms of ServiceContact Us