CVE-2026-104851: fsspec: Server-Side Template Injection in ReferenceFileSystem leads to Remote Code Execution
fsspec.implementations.reference.ReferenceFileSystem parses a “references”
JSON document (Kerchunk format) supplied either inline or via a URL. The
parser renders fields from this JSON through un-sandboxed
jinja2.Template(...).render(...) calls in three locations. An attacker who
controls the JSON document — typically by hosting it at a URL that the
victim opens with fsspec.filesystem("reference", fo=URL) or via
xarray.open_dataset("reference://...") — achieves arbitrary Python code
execution on the victim machine, before any data is read.
This mirrors the pattern of CVE-2024-34359
in llama-cpp-python, where externally-sourced template strings were
rendered with the default unrestricted Jinja2 environment.
References
- github.com/advisories/GHSA-27vj-qcqg-25rc
- github.com/fsspec/filesystem_spec/commit/86438783f93b1398ef245b92f0e6063b445b611c
- github.com/fsspec/filesystem_spec/commit/a1c16ab3f07f354aa371c38f7b1b07ea7fd4c5c8
- github.com/fsspec/filesystem_spec/pull/2029
- github.com/fsspec/filesystem_spec/pull/2039
- github.com/fsspec/filesystem_spec/releases/tag/2026.6.0
- github.com/fsspec/filesystem_spec/security/advisories/GHSA-27vj-qcqg-25rc
- nvd.nist.gov/vuln/detail/CVE-2026-104851
Code Behaviors & Features
Detect and mitigate CVE-2026-104851 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →