GHSA-4xgf-cpjx-pc3j: Directory Traversal and Symlink Following in Pydantic Settings
Vulnerability ID: GHSA-4XGF-CPJX-PC3J
CVSS Score: 5.3
Published: 2026-06-19
A directory traversal and symlink following vulnerability exists in Pydantic Settings when using the NestedSecretsSettingsSource with nested subdirectory lookups enabled. An attacker capable of writing to the secrets directory can bypass size limitations, read arbitrary host files, or cause a denial-of-service condition via cyclic symlinks.
TL;DR
Discrepant globbing behaviors in Pydantic Settings allow directory traversal and symlink resolution bypasses, leading to arbitrary local file read and infinite loops.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-59
- Attack Vector: Local
- CVSS Score: 5.3
- Exploit Status: Proof-of-Concept
- EPSS Percentile: N/A
- CISA KEV Status: Not Listed
- Affected Component: NestedSecretsSettingsSource
Affected Systems
- pydantic-settings
-
pydantic-settings: >= 2.12.0, < 2.14.2 (Fixed in:
2.14.2)
Mitigation Strategies
- Upgrade to pydantic-settings >= 2.14.2
- Disable nested secrets subdirectory lookups (secrets_nested_subdir=False)
- Enforce strict file permissions (0700) on the secrets directory to prevent unauthorized write or symlink insertion
Remediation Steps:
- Identify all projects using pydantic-settings with secrets configuration.
- Update requirements files to specify version 2.14.2 or higher.
- If immediate upgrade is not possible, modify model configuration to set secrets_nested_subdir=False.
- Verify permissions on configuration directories to prevent untrusted local users from inserting symlinks.
References
- GitHub Advisory Database Record
- Pydantic Settings Repository
- Vulnerability Resolution Pull Request (PR 889)
- Raw Patch/Diff Stream
- Pydantic-Settings Release Tag (v2.14.2)
Read the full report for GHSA-4XGF-CPJX-PC3J on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)