CVE-2026-58203
Received Received - Intake

Path Traversal in Pydantic Settings via Symbolic Links

Vulnerability report for CVE-2026-58203, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-06

Last updated on: 2026-07-06

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-06
Last Modified
2026-07-06
Generated
2026-07-06
AI Q&A
2026-07-06
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
pydantic pydantic-settings From 2.12.0 (inc) to 2.14.1 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-400 The product does not properly control the allocation and maintenance of a limited resource.
CWE-59 The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability exists in pydantic-settings versions 2.12.0 to 2.14.1 in the NestedSecretsSettingsSource component. When the setting secrets_nested_subdir is enabled, the software follows symbolic links inside the configured secrets directory that point to locations outside this directory. This behavior allows reading files outside the intended secrets directory.

Additionally, the vulnerability bypasses the secrets_dir_max_size protection because the size validation ignores symbolic links, while the secret loading process follows them. This inconsistency allows an attacker or lower-privileged user with write access to the secrets directory to read arbitrary local files or bypass size restrictions.

The issue is fixed in version 2.14.2 by preventing following symlinks outside the configured directory and using a consistent directory traversal method.

Impact Analysis

This vulnerability can allow an attacker or a lower-privileged component with write access to the configured secrets directory to read arbitrary local files outside the intended secrets directory.

Such unauthorized local file reads can expose sensitive information that was not meant to be accessible, potentially leading to information disclosure.

Moreover, the attacker can bypass the size limit protections on the secrets directory, possibly leading to further exploitation or resource exhaustion.

Detection Guidance

This vulnerability involves the presence of symbolic links inside the configured secrets directory that point outside of it, which can be exploited to read unintended files.

To detect this vulnerability on your system, you can check for symbolic links within the secrets directory that point outside the directory.

  • Use the command: find /path/to/secrets_dir -type l -exec ls -l {} \; to list all symbolic links and their targets.
  • Verify if any of these symbolic links point outside the configured secrets directory by examining their target paths.
  • Additionally, check if the pydantic-settings version in use is between 2.12.0 and 2.14.1, as these versions are vulnerable.
Mitigation Strategies

The primary mitigation step is to upgrade pydantic-settings to version 2.14.2 or later, where the vulnerability is fixed.

In the meantime, ensure that the configured secrets directory does not contain symbolic links pointing outside the directory.

Restrict write access to the secrets directory to trusted users only, preventing attackers or lower-privileged components from creating malicious symlinks.

Review and enforce proper permissions on the secrets directory and any mounts used for secrets to avoid unauthorized modifications.

Compliance Impact

This vulnerability allows an attacker with local access and write permissions to the configured secrets directory to read arbitrary files outside the intended secrets directory. Such unauthorized local file reads could lead to exposure of sensitive configuration data or secrets.

Exposure of sensitive data due to this vulnerability could potentially impact compliance with data protection regulations such as GDPR or HIPAA, which require strict controls over access to sensitive information and secrets.

Organizations relying on pydantic-settings for secrets management should upgrade to version 2.14.2 to mitigate this risk and maintain compliance with security best practices mandated by these standards.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-58203. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart