CVE-2026-58203: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and bypassing secrets_dir_max_size
pydantic-settings provides settings management using Pydantic. From 2.12.0 until 2.14.2, NestedSecretsSettingsSource reads secret values from files in a configured secretsdir. When secretsnestedsubdir=True, a directory entry inside secretsdir that is a symbolic link pointing outside secretsdir is followed, so files outside the configured directory are read into settings values. The same code path bypasses the documented secretsdirmaxsize protection. An attacker or lower-privileged component able to influence entries in the configured secrets directory (for example, a writable or shared secrets mount) can turn this into an unintended local file read into settings and can defeat the advertised loading-size cap. This vulnerability is fixed in 2.14.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pydantic-settings/NestedSecretsSettingsSourceto a version that resolves this vulnerability.Fixed in 2.14.2 - Compensating control
Ensure the configured secrets_dir is not writable by an attacker/lower-privileged component and prevent symlink entries inside secrets_dir from pointing outside secrets_dir (especially when secrets_nested_subdir=True) to mitigate local file read and bypass of secrets_dir_max_size.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-58203?
The severity of CVE-2026-58203 is rated as medium with a score of 5.3.
What does CVE-2026-58203 exploit?
CVE-2026-58203 exploits a path traversal vulnerability in NestedSecretsSettingsSource allowing local file reading.
How do I fix CVE-2026-58203?
To fix CVE-2026-58203, update pydantic-settings to version 2.14.3 or later.
What are the potential impacts of CVE-2026-58203?
The potential impacts of CVE-2026-58203 include unauthorized access to sensitive files and a bypass of the secrets_dir_max_size.
Which versions of pydantic-settings are affected by CVE-2026-58203?
Versions of pydantic-settings from 2.12.0 to 2.14.2 are affected by CVE-2026-58203.