CVE-2026-104851: CWE-94: Improper Control of Generation of Code ('Code Injection') in fsspec filesystem_spec
fsspec is a specification and Python implementation framework for filesystem interfaces. From 0.9.0 until 2026.6.0, fsspec.implementations.reference.ReferenceFileSystem evaluates fields from Kerchunk reference JSON documents through unrestricted jinja2.Template(...).render(...) calls in _process_references1._render_jinja, _process_templates, and _process_gen in fsspec/implementations/reference.py. A document supplied inline or fetched from an attacker-controlled URL can provide template expressions that execute Python code when the reference filesystem is opened, including through consumers such as xarray, before referenced data is read. The _process_gen path is reached whenever a document includes a gen array, while the other paths depend on template-related options and values. This issue is fixed in version 2026.6.0.
AI Analysis
Technical Summary
The vulnerability exists in fsspec's ReferenceFileSystem implementation, which evaluates fields from Kerchunk reference JSON documents using unrestricted jinja2.Template(...).render(...) calls in the functions _process_references1._render_jinja, _process_templates, and _process_gen. An attacker supplying a malicious JSON document inline or via a URL can inject template expressions that execute arbitrary Python code when the filesystem is opened, including through consumers like xarray. The _process_gen function is invoked whenever the document includes a gen array, while the other vulnerable paths depend on template-related options. This improper control of code generation (CWE-94) leads to remote code execution. The issue is resolved in fsspec version 2026.6.0.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code remotely with no privileges required and only user interaction needed. This can lead to full compromise of the environment running the vulnerable fsspec version, including confidentiality, integrity, and availability impacts. The CVSS v3.1 score is 8.8 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade to fsspec version 2026.6.0 or later, where this code injection vulnerability is fixed. No other mitigations are documented. Users should avoid opening untrusted Kerchunk reference JSON documents with vulnerable versions. Patch status is confirmed fixed in 2026.6.0.
CVE-2026-104851: CWE-94: Improper Control of Generation of Code ('Code Injection') in fsspec filesystem_spec
Description
fsspec is a specification and Python implementation framework for filesystem interfaces. From 0.9.0 until 2026.6.0, fsspec.implementations.reference.ReferenceFileSystem evaluates fields from Kerchunk reference JSON documents through unrestricted jinja2.Template(...).render(...) calls in _process_references1._render_jinja, _process_templates, and _process_gen in fsspec/implementations/reference.py. A document supplied inline or fetched from an attacker-controlled URL can provide template expressions that execute Python code when the reference filesystem is opened, including through consumers such as xarray, before referenced data is read. The _process_gen path is reached whenever a document includes a gen array, while the other paths depend on template-related options and values. This issue is fixed in version 2026.6.0.
CVSS v3.1
Score 8.8high
Affected software
fsspec
filesystem_spec
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in fsspec's ReferenceFileSystem implementation, which evaluates fields from Kerchunk reference JSON documents using unrestricted jinja2.Template(...).render(...) calls in the functions _process_references1._render_jinja, _process_templates, and _process_gen. An attacker supplying a malicious JSON document inline or via a URL can inject template expressions that execute arbitrary Python code when the filesystem is opened, including through consumers like xarray. The _process_gen function is invoked whenever the document includes a gen array, while the other vulnerable paths depend on template-related options. This improper control of code generation (CWE-94) leads to remote code execution. The issue is resolved in fsspec version 2026.6.0.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code remotely with no privileges required and only user interaction needed. This can lead to full compromise of the environment running the vulnerable fsspec version, including confidentiality, integrity, and availability impacts. The CVSS v3.1 score is 8.8 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade to fsspec version 2026.6.0 or later, where this code injection vulnerability is fixed. No other mitigations are documented. Users should avoid opening untrusted Kerchunk reference JSON documents with vulnerable versions. Patch status is confirmed fixed in 2026.6.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-02T14:38:43.244Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6abfdfeca43b0b3b89da151b
Added to database: 10/02/2026, 16:46:36 UTC
Last enriched: 10/02/2026, 17:01:03 UTC
Last updated: 10/02/2026, 17:46:47 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.