Skip to main content

pydantic-settings EUVDEUVD-2026-41878

| CVE-2026-58203 MEDIUM
Path Traversal (CWE-22)
2026-07-06 GitHub_M
5.3
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain write access to shared secrets_dir
  2. Delivery
    Create symlink inside secrets_dir targeting sensitive host file
  3. Exploit
    Trigger application settings reload (restart or live reload)
  4. Execution
    NestedSecretsSettingsSource follows symlink outside directory boundary
  5. Persist
    Sensitive file contents loaded into application settings
  6. Impact
    Data exposed via application behavior, logs, or API responses

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires two concrete conditions: (1) the application must instantiate NestedSecretsSettingsSource with secrets_nested_subdir=True - this is a non-default opt-in configuration, not enabled by default; (2) the attacker or a lower-privileged process must have write access to the configured secrets_dir, for example via a shared or world-writable mount. The CVSS PR:L confirms low-privileged local access is sufficient once these conditions are met. Exploitation is strictly local (AV:L) - remote unauthenticated exploitation is not possible. Deployments with secrets_nested_subdir omitted or set to False, or where secrets_dir is mounted read-only and owned exclusively by the application, are not exploitable regardless of library version.

Impact

The CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L, score 5.3) accurately characterizes the attack surface: local access with low privileges is required, complexity is low, and no user interaction is needed. The partial C/I/A ratings reflect that the attacker reads files into application settings rather than gaining full filesystem read or write. No EPSS score was provided in the available intelligence, making probabilistic exploitation assessment unavailable. The absence of a KEV listing and any public POC lowers urgency relative to the CVSS score alone. Real-world risk is elevated in containerized or microservice environments - particularly Kubernetes deployments - where secrets are mounted as shared volumes and multiple workloads may have write access to the same mount. In tightly controlled environments where secrets_dir is owned exclusively by the application process, exploitation surface is minimal. The secrets_dir_max_size bypass adds an integrity and availability dimension that the base CVSS score partially captures but may understate in high-sensitivity deployments.

Exploit ScenarioDerived

A lower-privileged sidecar container or compromised process sharing a writable Kubernetes secrets volume creates a symbolic link inside the application's secrets_dir - for example, secrets/db/password -> /etc/shadow - and waits for the application to restart or reload configuration. When the application initializes NestedSecretsSettingsSource with secrets_nested_subdir=True, the symlink is followed and the contents of /etc/shadow are loaded into the db.password settings field, potentially surfacing in logs, error messages, or downstream API responses. No public POC has been identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 06, 2026

Symlink traversal in pydantic-settings 2.12.0-2.14.1 allows a local low-privileged attacker with write access to the configured secrets directory to read arbitrary files from the host filesystem into application settings when secrets_nested_subdir=True. The same code path also bypasses the secrets_dir_max_size loading cap, undermining an advertised safety control. No public exploit or CISA KEV listing exists; the vendor-released fix is version 2.14.2.

RemediationAI

Upgrade pydantic-settings to version 2.14.2, the vendor-confirmed fix per the GitHub Security Advisory GHSA-4xgf-cpjx-pc3j (https://github.com/pydantic/pydantic-settings/security/advisories/GHSA-4xgf-cpjx-pc3j). If an immediate upgrade is not feasible, disable the nested subdirectory feature by setting secrets_nested_subdir=False or omitting it from the source configuration; note this removes the ability to load hierarchically nested secrets from subdirectories. As an additional compensating control, mount secrets_dir as read-only or restrict write permissions to the owning application user only, preventing lower-privileged components from planting symlinks - this does not patch the traversal but removes the attacker's ability to create the malicious entry. Restricting secrets_dir to a dedicated ephemeral volume rather than a shared mount further limits lateral exposure in multi-tenant container environments.

Affected VersionsENISA

pydantic-settings 2.12.0, < 2.14.2

Affected Packages

pypi pydantic-settings fix: 2.14.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

pydantic-settings is a Python configuration-management library built on Pydantic, commonly used in FastAPI and other modern Python applications to load secrets from files in a designated directory. The NestedSecretsSettingsSource component, when secrets_nested_subdir=True, recursively descends into subdirectories of secrets_dir to populate nested settings models. The root cause is CWE-22 (Path Traversal): the traversal logic follows symbolic links without validating that their resolved targets remain within the secrets_dir boundary, effectively breaking the directory jail. The affected CPE is cpe:2.3:a:pydantic:pydantic-settings:*:*:*:*:*:*:*:* for versions 2.12.0 through 2.14.1. A secondary consequence is that the same traversal bypasses the documented secrets_dir_max_size guard, meaning an attacker can also cause the application to ingest arbitrarily large files, defeating a defense-in-depth control.

Know when Pydantic gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 5.3 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
vuln.today AI 5.3 MEDIUM

Write access to secrets_dir required (PR:L, AV:L); partial C/I/A since impact is limited to settings-loaded file contents and size-cap bypass.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
Red Hat 5.3 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

Lifecycle Timeline

1
Patch available
Jul 06, 2026 - 17:01 EUVD

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 88 pypi packages depend on pydantic-settings (80 direct, 8 indirect)

Ecosystem-wide dependent count for version 2.12.0.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Medium
popular Python settings library, widely used in FastAPI ecosystems
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

CVE-2025-55526 CRITICAL POC
9.1 Aug 26

n8n-workflows Main Commit ee25413 allows attackers to execute a directory traversal via the download_workflow function w

CVE-2026-25580 HIGH POC
8.6 Feb 06

Pydantic AI versions 0.0.26 through 1.55.x contain a server-side request forgery vulnerability in URL download functiona

CVE-2024-3772 HIGH POC
7.5 Apr 15

Regular expression denial of service in Pydanic < 2.4.0, < 1.10.13 allows remote attackers to cause denial of service vi

CVE-2026-84381 HIGH
8.1 Sep 02

HTTPX2's SOCKS5 proxy implementation omits TLS negotiation for WebSocket Secure (wss://) origins, exposing the full WebS

CVE-2026-107295 HIGH
7.6 Oct 08

Cross-site request forgery in Pydantic AI's development web chat UI allows any website a developer happens to visit whil

CVE-2026-107286 HIGH
7.5 Oct 08

Concurrency slot exhaustion in Pydantic AI 2.10.0 through 2.52.x lets streamed model requests permanently occupy slots i

CVE-2026-84382 HIGH
7.5 Sep 02

Memory exhaustion via unbounded decompression in HTTPX2 (all versions before 2.12.0) allows any HTTP server the client c

CVE-2021-29510 HIGH
7.5 May 13

Pydantic is a data validation and settings management using Python type hinting. Rated high severity (CVSS 7.5), this vu

CVE-2026-48782 MEDIUM
6.8 Jun 16

Server-Side Request Forgery in Pydantic AI (versions 1.56.0-1.101.0, 2.0.0b1, 2.0.0b2) allows unauthenticated network at

CVE-2026-107289 MEDIUM
6.8 Oct 08

Server-side request forgery in Pydantic AI's URL-fetching guards lets an application that has explicitly opted a URL int

CVE-2026-54249 MEDIUM POC
6.8 Jul 29

Server-Side Request Forgery in Pydantic AI's UI adapter layer (versions 1.65.0-1.105.0 and 2.0.0b1-2.0.0b5) allows unaut

CVE-2026-107294 MEDIUM
6.5 Oct 08

Pydantic AI, a Python framework for building Generative AI agents, buffers complete HTTP response bodies before applying

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy