CVE-2026-58203 pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and bypassing secrets_dir_max_size
Attackers with write access to the secrets directory can use symlinks to read arbitrary local files and bypass size limits in pydantic-settings.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-58203?
CVE-2026-58203 is a medium-severity path traversal vulnerability in pydantic-settings, published on 6 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
pydantic-settings provides settings management using Pydantic. From 2.12.0 until 2.14.2, NestedSecretsSettingsSource reads secret values from files in a configured secrets_dir. When secrets_nested_subdir=True, a directory entry inside secrets_dir that is a symbolic link pointing outside secrets_dir is followed, so files outside the configured directory are read into settings values. The same code path bypasses the documented secrets_dir_max_size 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.
Which versions are affected by CVE-2026-58203?
2 open source packages ship an affected version, including pydantic-settings. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pydantic-settings PyPI | From 2.12.0 | 2.14.2 |
pydantic-settings PyPI | From 2.12.0 | 2.14.2 |
Products include Pydantic Pydantic-Settings.
How do I fix CVE-2026-58203?
Upgrade pydantic-settings to 2.14.2 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-58203 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-58203 exists.
Sources
Also known as CLEANSTART-2026-OQ12985, CLEANSTART-2026-UR05991, DEBIAN-CVE-2026-58203, ECHO-c128-4f87-8dda, GHSA-4xgf-cpjx-pc3j, MGASA-2026-0260 and 19 more.