CVE-2026-58203: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in pydantic pydantic-settings
A path traversal vulnerability exists in pydantic-settings versions 2.12.0 through 2.14.2 in the NestedSecretsSettingsSource component. When the secrets_nested_subdir option is enabled, symbolic links inside the configured secrets directory that point outside it are followed, allowing files outside the intended directory to be read into settings values. This also bypasses the configured maximum size protection for loading secrets. The vulnerability allows a lower-privileged attacker who can influence the secrets directory contents to read unintended local files. The issue is fixed starting from version 2.14.2.
AI Analysis
Technical Summary
pydantic-settings versions from 2.12.0 up to and including 2.14.2 contain a path traversal vulnerability (CWE-22) in the NestedSecretsSettingsSource feature. When secrets_nested_subdir is set to true, symbolic links within the secrets_dir that point outside the directory are followed, enabling reading of files outside the intended secrets directory. This behavior also circumvents the secrets_dir_max_size protection, potentially allowing excessive data to be loaded. An attacker or lower-privileged component with write or influence over the secrets directory can exploit this to read arbitrary local files into settings. The vulnerability is addressed in version 2.14.2.
Potential Impact
An attacker or lower-privileged component able to modify or influence the contents of the configured secrets directory can exploit this vulnerability to read arbitrary local files outside the intended secrets directory. This can lead to unauthorized disclosure of sensitive information. Additionally, the bypass of the loading-size cap may allow excessive resource consumption. The CVSS score is 5.3 (medium severity), indicating limited but meaningful confidentiality, integrity, and availability impacts.
Mitigation Recommendations
This vulnerability is fixed in pydantic-settings version 2.14.2. Users should upgrade to version 2.14.2 or later to remediate this issue. No official patch or temporary fix is indicated beyond upgrading. Until upgraded, ensure that the secrets directory is not writable or modifiable by untrusted or lower-privileged users to reduce exploitation risk.
CVE-2026-58203: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in pydantic pydantic-settings
Description
A path traversal vulnerability exists in pydantic-settings versions 2.12.0 through 2.14.2 in the NestedSecretsSettingsSource component. When the secrets_nested_subdir option is enabled, symbolic links inside the configured secrets directory that point outside it are followed, allowing files outside the intended directory to be read into settings values. This also bypasses the configured maximum size protection for loading secrets. The vulnerability allows a lower-privileged attacker who can influence the secrets directory contents to read unintended local files. The issue is fixed starting from version 2.14.2.
CVSS v3.1
Score 5.3medium
Affected software
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
pydantic-settings versions from 2.12.0 up to and including 2.14.2 contain a path traversal vulnerability (CWE-22) in the NestedSecretsSettingsSource feature. When secrets_nested_subdir is set to true, symbolic links within the secrets_dir that point outside the directory are followed, enabling reading of files outside the intended secrets directory. This behavior also circumvents the secrets_dir_max_size protection, potentially allowing excessive data to be loaded. An attacker or lower-privileged component with write or influence over the secrets directory can exploit this to read arbitrary local files into settings. The vulnerability is addressed in version 2.14.2.
Potential Impact
An attacker or lower-privileged component able to modify or influence the contents of the configured secrets directory can exploit this vulnerability to read arbitrary local files outside the intended secrets directory. This can lead to unauthorized disclosure of sensitive information. Additionally, the bypass of the loading-size cap may allow excessive resource consumption. The CVSS score is 5.3 (medium severity), indicating limited but meaningful confidentiality, integrity, and availability impacts.
Mitigation Recommendations
This vulnerability is fixed in pydantic-settings version 2.14.2. Users should upgrade to version 2.14.2 or later to remediate this issue. No official patch or temporary fix is indicated beyond upgrading. Until upgraded, ensure that the secrets directory is not writable or modifiable by untrusted or lower-privileged users to reduce exploitation risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-29T17:09:25.872Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a4bcbb327e9c79719c0cebf
Added to database: 07/06/2026, 15:37:23 UTC
Last enriched: 07/06/2026, 15:52:30 UTC
Last updated: 07/06/2026, 16:25:06 UTC
Views: 4
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.
External Links
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.