# Twig remote code execution in templates

Advisory record · `GHSA-xw83-pwrm-9j74`

- **Identifiers:** `GHSA-xw83-pwrm-9j74` · `CVE-2015-7809` · `PKSA-19rw-dqx2-75hc`
- **State:** Confirmed
- **Severity:** CVSS 8.1 High
- **Critical:** No
- **Weakness (CWE):** [CWE-74](https://cwe.mitre.org/data/definitions/74.html)
- **Tags:** [Other injection](https://agentprime.io/advisories/tag/injection.md)
- **Published:** 14 May 2022
- **Updated:** 30 May 2024
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 14 May 2022, 02:03 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `twig/twig` (Packagist): affected `<1.20.0`; fixed in `1.20.0`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> Twig (twig/twig) versions before 1.20.0 are vulnerable. When Sandbox mode is enabled, a remote attacker can use the \_self variable in a template to execute arbitrary code. Upgrade to Twig 1.20.0 or later.

Written 4 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.1 High, CVSS 3.1: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`, from GitHub Advisory Database

- **CISA KEV:** Not listed.
- **EPSS:** 0.034, the 89th percentile, on 19 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 31 Oct 2026, 14:29 UTC: First seen by agentprime
- 31 Oct 2026, 14:29 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-xw83-pwrm-9j74)

## Sources

- [GitHub Advisory Database: GHSA-xw83-pwrm-9j74](https://github.com/advisories/GHSA-xw83-pwrm-9j74)
- [OSV: GHSA-xw83-pwrm-9j74](https://osv.dev/vulnerability/GHSA-xw83-pwrm-9j74)
- <https://nvd.nist.gov/vuln/detail/CVE-2015-7809>
- <https://github.com/twigphp/Twig/pull/1759>
- <https://github.com/twigphp/Twig/commit/30be07759a3de2558da5224f127d052ecf492e8f>
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2015-7809.yaml>
- <https://github.com/twigphp/Twig>
- <https://symfony.com/blog/security-release-twig-1-20-0>
- <http://openwall.com/lists/oss-security/2015/08/21/3>
- <http://openwall.com/lists/oss-security/2015/10/11/2>
- <http://symfony.com/blog/security-release-twig-1-20-0>
- <http://www.debian.org/security/2015/dsa-3343>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-xw83-pwrm-9j74>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-xw83-pwrm-9j74/>. Everything for agents: <https://agentprime.io/llms.txt>.
