CVE-2024-41672: DuckDB: sniff_csv provides filesystem access even when enable_external_access is disabled

Published Jul 24, 2024
·
Updated

Summary Content in filesystem is accessible for reading using sniffcsv, even with enableexternalaccess=false.

Details During a pentest, a security researcher was able to access environment variable data and other system data by using the sniffcsv function, even though we set enableexternalaccess to false.

PoC SQL SET enableexternalaccess=false; SET lockconfiguration=true;

SELECT Columns FROM sniffcsv('/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 readcsv('/proc/self/environ') fails with a permission error.

There seems to be two vectors to this vulnerability: 1. Access to files that should otherwise not be allowed. (We expect Permission Error: Scanning CSV files is disabled through configuration and not to provide any access to the file or even acknowledge that it exists). 2. 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 sniffcsv 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 disabledfilesystems setting: SQL SET disabledfilesystems='LocalFileSystem'; SET lockconfiguration=true;

SELECT Columns FROM sniffcsv('/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.

Other sources

DuckDB is a SQL database management system. In versions 1.0.0 and prior, content in filesystem is accessible for reading using sniffcsv, even with enableexternalaccess=false. This vulnerability provides an attacker with access to filesystem even when access is expected to be disabled and other similar functions do NOT provide access. There seem to be two vectors to this vulnerability. First, access to files that should otherwise not be allowed. Second, the content from a file can be read (e.g. /etc/hosts, proc/self/environ, etc) even though that doesn't seem to be the intent of the sniffcsv function. A fix for this issue is available in commit c9b7c98aa0e1cd7363fe8bb8543a95f38e980d8a and is expected to be part of version 1.1.0.

— MITRE

Affected Software

2 affected componentsFixes available
pip/duckdb>=1.0.0<1.1.0
1.1.0
DuckDB DuckDB<1.1.0

Event History

Jul 24, 2024
CVE Published
via MITRE·05:47 PM
Data Sourced
via MITRE·05:47 PM
DescriptionSeverityWeakness
Jan 21, 2025
Advisory Published
via GitHub·09:07 PM
Data Sourced
via GitHub·09:07 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-41672?

CVE-2024-41672 is considered a high-severity vulnerability due to unauthorized filesystem access.

2

How do I fix CVE-2024-41672?

To fix CVE-2024-41672, upgrade DuckDB to version 1.1.0 or later.

3

What systems are affected by CVE-2024-41672?

CVE-2024-41672 affects DuckDB versions up to 1.1.0, allowing filesystem access even with restricted settings.

4

What is the impact of CVE-2024-41672?

The impact of CVE-2024-41672 includes exposure of sensitive environment variable data through the sniff_csv function.

5

Is external access required for CVE-2024-41672 to be exploited?

No, CVE-2024-41672 can be exploited even when external access is disabled.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203