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.
Published: 2026-07-06
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability allows an attacker or a lower‑privileged component that can influence the configured secrets directory to create a symbolic link pointing outside that directory. The NestedSecretsSettingsSource will follow that link when loading secret values, resulting in arbitrary local file reads. Additionally, the same code path bypasses the documented secrets_dir_max_size limit, allowing the attacker to read a file regardless of its size. This flaw is a classic path traversal issue (CWE‑22) combined with unvalidated read size (CWE‑400) and improper symlink handling (CWE‑59).

Affected Systems

The product affected is Pydantic‑Settings, version 2.12.0 up through but not including 2.14.2. Any deployment using a version in this range is vulnerable.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity, while an EPSS score of less than 1 % indicates a low likelihood of exploitation at present. The vulnerability is not present in CISA’s KEV catalog. Exploitation requires that the attacker or untrusted process has write access to the secrets directory in order to create or modify a symbolic link that points outside the intended path. The flaw is local and does not provide remote code execution, but it can lead to data disclosure by exposing file contents and bypassing size limits.

Generated by OpenCVE AI on July 26, 2026 at 20:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Pydantic‑Settings to version 2.14.2 or later to prevent following external symbolic links and to enforce the maximum file size constraint.
  • Restrict write permissions on the configured secrets directory so that only trusted users or processes can create or modify files, thereby eliminating the ability to insert malicious symbolic links.
  • If upgrading immediately is not possible, remove any existing symbolic links in the secrets directory that point outside the configured path or adjust them so they point within the allowed directory.

Generated by OpenCVE AI on July 26, 2026 at 20:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 10 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 06 Jul 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Pydantic
Pydantic pydantic-ai
Vendors & Products Pydantic
Pydantic pydantic-ai

Mon, 06 Jul 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 06 Jul 2026 15:45:00 +0000

Type Values Removed Values Added
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.
Title NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and bypassing secrets_dir_max_size
Weaknesses CWE-22
CWE-400
CWE-59
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L'}


Subscriptions

Pydantic Pydantic-ai
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-06T16:19:59.090Z

Reserved: 2026-06-29T17:09:25.872Z

Link: CVE-2026-58203

cve-icon Vulnrichment

Updated: 2026-07-06T16:19:54.963Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-06T14:24:15Z

Links: CVE-2026-58203 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-26T20:45:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')