DEV Community

jeffrey
jeffrey

Posted on

OpenAgents Data Agent code injection shows why evaluation code needs a sandbox

OpenAgents Data Agent code injection shows why evaluation code needs a sandbox

OpenAgents' Data Agent is designed to turn a question into analysis code and run it against data. CVE-2026-138332 identifies a code injection weakness in run_program_local inside real_agents/data_agent/evaluation/python_evaluator.py. The affected rolling revision is identified in the CVE record as ff2e46440699af1324eb25655b622c4a131265bb. The CNA describes remote code injection and a CVSS 4.0 base score of 5.5.

The exact exploit input is not needed to understand the boundary. A local Python evaluator exists to accept executable text from an agent workflow. If that text is treated as trusted simply because a model generated it, an attacker who can influence the prompt, dataset, tool output, or stored evaluation template can steer the evaluator. The result is not a model answer. It is code running in the host process with access to imports, files, environment variables, and network paths available to that process.

The CVE record states that a patch was proposed but was still awaiting acceptance when the record was published. That makes version pinning and containment more important than a blanket claim that a fixed release exists. Operators should identify the deployed commit, review the issue and pull request, and move only to a revision whose maintainers have accepted and tested the fix. A fork with an unreviewed local edit should not be treated as equivalent to an upstream fix.

The safer execution model is a separate process with a minimal interpreter and an explicit artifact exchange. The evaluator should receive a data file and a program, run them in a disposable container, and return a result file. The container should not inherit API keys, cloud credentials, browser sessions, or the host's SSH agent. It should have a read-only root filesystem, a writable temporary directory, bounded CPU and memory, and an egress policy that allows only destinations required by the analysis.

Prompt injection controls can reduce how often an untrusted instruction reaches the evaluator, but they cannot replace process isolation. A user can upload a malicious dataset whose column names contain instructions. A tool can return a page that tells the agent to inspect environment variables. An LLM may decide that a shell command is the easiest way to inspect a file. The platform should assume some of these requests will occur and make the resulting code harmless outside its sandbox.

Review the approval hook separately from the Python execution path. A visible confirmation dialog is useful only if the action being approved is the same action the backend executes. Record the normalized program, the data source, the container image, the user identity, and the result hash. If a program is edited after approval, invalidate the approval and require a new one. Logs should not contain secrets copied from the environment.

Detection should focus on process and container behavior. Look for Python evaluation containers spawning shells, reading cloud metadata addresses, writing outside their temporary directory, or opening connections to unexpected hosts. Alert on a sudden increase in child processes, repeated permission errors, and attempts to read credential files. These signals do not prove exploitation, but they justify isolating and inspecting the job.

OpenAgents can remain a useful research platform. The security requirement is to make its local evaluator an untrusted execution service. Pin reviewed source, keep secrets out of that process, isolate network and filesystem access, and treat model-generated code as potentially hostile input.

References

Top comments (0)