GitLab found critical RCE in Serena MCP (GHSA-pp25-4cg4-qcr9): malicious .serena/project.yml + Jinja could run code on open. Update serena-agent 1.7.0. MCP is a high-privilege local attack surface for after-work learners.
If you open Cursor or Claude after dinner and point an MCP coding agent at a fresh GitHub clone, you are not only reading code. You are granting a local process the same reach you have on your laptop: files, shell, keys, .env, and browser sessions. That is why a critical remote code execution finding in Serena matters for after-work Python learners—not only for full-time security teams.
GitLab’s Threat Research Group reported a critical server-side template injection in Serena (Critical remote code execution in Serena, GHSA-pp25-4cg4-qcr9; CVE pending at disclosure). On serena-agent 1.6.1 and earlier, attacker-controlled project config could run code as soon as you open the repository through Serena’s MCP server. Maintainers shipped serena-agent 1.7.0 on 2026-08-09. If you use Serena, update now.
Evening learners often do the “safe-looking” things that still expand the attack surface:
.serena/.That workflow is normal when you have 45–90 minutes after work. It is also exactly the delivery path GitLab describes: a malicious .serena/project.yml in a repository the attacker controls, opened via Serena MCP.
Serena markets itself as “the IDE for your agent.” It connects assistants to a local codebase over MCP with tools beyond raw file I/O. You typically start something like serena start-mcp-server --project /path/to/repo. Because it runs with your OS user privileges, Serena ships a trust gate (trusted_project_path_patterns) meant to keep untrusted projects from running privileged hooks such as activation_command. GitLab showed the trust gate did not cover the mode-prompt path that rendered Jinja templates.
At a conceptual level—enough to stay safe, not enough to weaponize:
prompt text is injected into the agent system prompt.Environment() (not the sandboxed variant).prompt string later hit the template engine.GitLab confirmed empirically that with trust patterns empty (nothing trusted), activation_command stayed blocked while the template path still executed. They frame that as a protection-mechanism failure (CWE-693): the trust model’s purpose was defeated by an alternate path that still looked like ordinary project loading.
Code ran as a side effect of project open—before Serena served its first request to the LLM. You do not need to “ask the agent to run something dangerous.” Opening the project was enough.
| Date | Event |
|---|---|
| 2026-08-01 | Vulnerability identified; full advisory and PoC submitted privately |
| 2026-08-05 | Report accepted by maintainers |
| 2026-08-09 | Fix in serena-agent 1.7.0; public advisory GHSA-pp25-4cg4-qcr9 |
| 2026-08-10 | CVE requested with the GitHub CNA by maintainers |
Source: GitLab Threat Research — Critical RCE in Serena. Do not invent CVE IDs beyond what that advisory states (CVE was still pending at publication).
A linter mostly reads files. A formatter writes them. A test runner executes a harness. MCP servers often hand an LLM a general interface: filesystem, shell, language-server queries, sometimes network. GitLab’s point is blunt: CI runs in scoped sandboxes; MCP often runs on your machine, as you.
Compromise the server process and you inherit whatever your evening session can touch—SSH keys, cloud creds, secrets files, internal VPN routes. Serena’s scale makes the lesson sticky: GitLab cites roughly 27.8k GitHub stars, 1.8k forks, and about 136,000 monthly PyPI downloads for serena-agent, with integrations across Claude Code, Cursor, VS Code, JetBrains IDEs, Claude Desktop, and OpenWebUI.
This is not “AI magic.” It is classic insecure handling of untrusted project input—template injection and incomplete trust coverage—landing in a new packaging shape. Similar gaps will show up in other MCP tools that treat repo config as “part of the product” instead of hostile input.
If you use Serena
jinja2.sandbox.SandboxedEnvironment..serena/ configs like surprise shell scripts.If you use any MCP coding agent (Cursor, Claude, Copilot, etc.)
If you are building or configuring MCP tools
This post is awareness for employed people learning Python after work—not a CTF write-up, not a remake of our Top 10 AI agent tools list, and not investment or “quant course” enrollment advice. Agents draft; you still own the machine and the .py file.
If you want short, after-work lessons that keep you in a real interpreter loop—write, run, read the traceback—start with Introduction to Python Programming. Nineteen published lessons, paced for evenings. It is not a bootcamp pitch and not a subsidised credential.
Primary reporting and technical narrative: GitLab Threat Research, Critical remote code execution in Serena, a popular MCP coding agent (found 2026-08-01; fix 1.7.0 / GHSA-pp25-4cg4-qcr9 on 2026-08-09).