Symlink Attack Affecting pydantic-settings package, versions [2.12.0,2.14.2)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.18% (8th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Symlink Attack vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PYDANTICSETTINGS-17675228
  • published29 Jun 2026
  • disclosed19 Jun 2026
  • creditUnknown

Introduced: 19 Jun 2026

CVE-2026-58203  (opens in a new tab)
CWE-22  (opens in a new tab)
CWE-59  (opens in a new tab)

How to fix?

Upgrade pydantic-settings to version 2.14.2 or higher.

Overview

pydantic-settings is a Settings management using Pydantic

Affected versions of this package are vulnerable to Symlink Attack in the NestedSecretsSettingsSource process when secrets_nested_subdir is enabled and a symbolic link inside the configured secrets directory points outside of it. An attacker can access files outside the intended directory and bypass configured size restrictions by placing crafted symbolic links within the secrets directory. This is only exploitable if an attacker or lower-privileged component can create or modify entries in the configured secrets directory.

Workaround

This vulnerability can be mitigated by ensuring the configured secrets directory is fully owned and controlled by the application, or by avoiding the use of secrets_nested_subdir=True.

References

CVSS Base Scores

version 4.0
version 3.1