CVE-2026-27952·Python vulnerability
Agenta is an open-source LLMOps platform. In Agenta-API prior to version 0.48.1, a Python sandbox escape vulnerability existed in Agenta's custom code evaluator. Agenta used RestrictedPython as a sandboxing mechanism for user-supplied evaluator code, but incorrectly whitelisted the `numpy` package as safe within the sandbox. This allowed authenticated users to bypass the sandbox and achieve arbitrary code execution on the API server. The escape path was through `numpy.ma.core.inspect`, which exposes Python's introspection utilities — including `sys.modules` — thereby providing access to unfiltered system-level functionality like `os.system`. This vulnerability affects the Agenta self-hosted platform (API server), not the SDK when used as a standalone Python library. The custom code evaluator runs server-side within the API process. The issue is fixed in v0.48.1 by removing `numpy` from the sandbox allowlist. In later versions (v0.60+), the RestrictedPython sandbox was removed entirely and replaced with a different execution model.
- Severity
- high
- Software
- Python
- Fixed in
- 0.48.1
- Published
- 2026-02-26
Affected versions
Until: 0.48.1
Fixed in: 0.48.1
How to fix this CVE
If you are running Agenta self-hosted API server, upgrade to version 0.48.1 or later immediately to remove the unsafe numpy whitelisting from the RestrictedPython sandbox. Organizations using Agenta v0.60+ benefit from an architecture redesign that eliminated the RestrictedPython sandbox entirely. Verify your deployment version and apply the patch as soon as possible, since this vulnerability allows authenticated users to execute arbitrary code on your API infrastructure.
sudo dnf update python3Defensia detects this vulnerability
WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement authentication-based rate limiting on all API endpoints that expose the custom code evaluator to prevent credential-based brute force attacks that could lead to exploitation of this vulnerability by low-privilege accounts.How to check if you are affected
- Step 1: Check your Agenta installation version by running `pip show agenta` or `pip show agenta-api` and confirm the version is below 0.48.1
- Step 2: If running Agenta API, verify RestrictedPython is in your requirements by running `pip show RestrictedPython` and check if numpy is in your allowed sandbox packages in the evaluator configuration
- Step 3: Search API server logs for unexpected numpy introspection patterns: `grep -r 'numpy.ma.core.inspect\|sys.modules' /var/log/agenta* 2>/dev/null` or check for suspicious os.system calls in evaluator execution logs
- Step 4: After patching, re-run `pip show agenta-api` and confirm version is 0.48.1 or higher, then restart the API service with `sudo systemctl restart agenta-api` (adjust service name as needed)
FAQ
What is CVE-2026-27952?
CVE-2026-27952 is a sandbox escape vulnerability in Agenta's custom code evaluator where numpy was incorrectly whitelisted in RestrictedPython, allowing authenticated attackers to access introspection utilities and execute arbitrary system commands on the API server.
Is CVE-2026-27952 being actively exploited?
No, this vulnerability is not currently listed in the CISA KEV catalog and no public exploits have been disclosed, but the attack surface exists for any authenticated user with access to Agenta's custom evaluator feature.
What versions of Agenta are affected by CVE-2026-27952?
All versions of Agenta-API prior to 0.48.1 are affected; the fix was applied in 0.48.1 by removing numpy from the sandbox allowlist, and a complete architectural redesign occurred in v0.60+.
How do I check if my server is vulnerable to CVE-2026-27952?
Run `pip show agenta-api` and check if the version is below 0.48.1; if it is, your Agenta API server is vulnerable and requires immediate patching.
Does Defensia detect CVE-2026-27952?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Agenta-API is installed on a monitored server, CVE-2026-27952 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-27952. Free for 1 server.
Get started free