sniff_csv provides filesystem access even when enable_external_access is disabled in duckdb
Summary
Content in filesystem is accessible for reading using sniff_csv, even with enable_external_access=false.
Details
During a pentest, a security researcher was able to access environment variable data and other system data by using the sniff_csv function, even though we set enable_external_access to false.
PoC
SET enable_external_access=false;
SET lock_configuration=true;
SELECT Columns FROM sniff_csv('/proc/self/environ');
Impact
Provides an attacker with access to filesystem even when access is expected to be disabled and other similar functions do NOT provide access.
For example select * from read_csv('/proc/self/environ') fails with a permission error.
There seems to be two vectors to this vulnerability:
- Access to files that should otherwise not be allowed. (We expect
Permission Error: Scanning CSV files is disabled through configurationand not to provide any access to the file or even acknowledge that it exists). - The content from a (non-csv?) file can be read (e.g.
/etc/hosts,proc/self/environ, etc) even though that doesn't seem to be the intent of the sniff_csv function (my understanding is it's intending to provide information about the shape of the data, but not provide the data itself).
Workaround
It is possible to work around the issue by disabling the local file system using the disabled_filesystems setting:
SET disabled_filesystems='LocalFileSystem';
SET lock_configuration=true;
SELECT Columns FROM sniff_csv('/proc/self/environ');
will result in Permission Error: File system LocalFileSystem has been disabled by configuration.
Fix
A fix has been merged into the main branch (https://github.com/duckdb/duckdb/pull/13133), and will be released with the next DuckDB release.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | duckdb | >= 1.0.0, < 1.1.0 | 1.1.0 |
References
- https://github.com/duckdb/duckdb/security/advisories/GHSA-w2gf-jxc9-pf2q
- https://github.com/duckdb/duckdb/commit/c9b7c98aa0e1cd7363fe8bb8543a95f38e980d8a
- https://github.com/duckdb/duckdb/pull/13133
- https://github.com/advisories/GHSA-w2gf-jxc9-pf2q
- https://nvd.nist.gov/vuln/detail/CVE-2024-41672
- https://github.com/duckdb/duckdb
- https://github.com/pypa/advisory-database/tree/main/vulns/duckdb/PYSEC-2024-203.yaml
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-200- Platform
- Python (PyPI)
- Package
duckdb- Disclosed
- 24.07.2024
- Updated
- 11.10.2026 12:20
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2024-203 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-w2gf-jxc9-pf2q - CC BY 4.0
Vulnerability history: duckdb
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 3
- First → latest
- 01.2024 11.2025
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 1
- Medium 1
Disclosures per year
- 2024: 2
- 2025: 1
- 2026: 0
-
sniff_csv provides filesystem access even when enable_external_access is disabled in duckdb this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.