Skip to main content

Snyk agent scan: pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and bypassing secrets_dir_max_size (CVE-2026-58203)

0
Medium
Published: 08/13/2026 (08/13/2026, 17:35:48 UTC)
Source: GCVE Database
Product: snyk-agent-scan

Description

CVE-2026-58203 affects pydantic-settings versions >=0.4.3 and <0.5.11_1, where NestedSecretsSettingsSource with secrets_nested_subdir=True follows symbolic links outside the configured secrets_dir. This allows local files outside the intended directory to be read into settings, bypassing the secrets_dir_max_size limit. The vulnerability requires the ability to place symlinks inside the secrets directory and is not remotely exploitable by itself. The issue is fixed in pydantic-settings 2.14.2 by restricting directory traversal and consistent size accounting.

CVSS v3.1

Score 5.3medium

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L

Affected software

Homebrewmore threats →ghsa
snyk-agent-scan
pkg:brew/snyk-agent-scan
Affected versions
>=0.4.3 <0.5.11_1

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

AILast updated: 10/22/2026, 17:28:31 UTC

Technical Analysis

The NestedSecretsSettingsSource component in pydantic-settings reads secret values from files in a configured secrets_dir. When secrets_nested_subdir=True, it follows symbolic links inside secrets_dir that point outside, allowing files outside the directory to be read into settings values. The size check uses Path.glob which does not follow symlinks, while the loader uses glob.iglob which does, causing inconsistent size accounting and bypass of the secrets_dir_max_size limit. This enables unintended local file reads and resource usage amplification via cyclic symlinks. Exploitation requires the ability to place symlinks inside the secrets_dir. The vulnerability is patched in pydantic-settings 2.14.2, which enforces strict directory traversal within secrets_dir and consistent size checks.

Potential Impact

An attacker or lower-privileged component able to place symbolic links inside the configured secrets_dir can cause the application to read files outside the intended directory into settings values, violating confidentiality. Additionally, the secrets_dir_max_size limit can be bypassed, potentially leading to resource exhaustion. The vulnerability does not enable remote exploitation by itself and requires local or privileged access to influence the secrets directory contents.

Mitigation Recommendations

Upgrade to pydantic-settings version 2.14.2 or later, which fixes the vulnerability by restricting directory traversal to within the secrets_dir, using a single cycle-safe iterator for size checks and loading, and skipping files whose resolved paths escape the secrets_dir. If upgrading is not possible immediately, ensure the secrets_dir is fully controlled by the application with no writable or attacker-influenced entries, or disable secrets_nested_subdir=True.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
BREW-snyk-agent-scan-CVE-2026-58203
Osv Schema Version
1.7.3
Ecosystems
["Homebrew"]
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6ada44e64d27ba8daa6a52b0

Added to database: 10/22/2026, 17:16:22 UTC

Last enriched: 10/22/2026, 17:28:31 UTC

Last updated: 10/22/2026, 17:28:31 UTC

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses