fastapi · pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and
Affects fastapiSource GCVE Database
Not known to be exploited · CVSS 5.3 Medium : upgrade to 0.138.0 when convenient.
Data as of 9 Nov 2026, 20:02 UTC
- Patch
- Available – fixed in 0.138.0
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:LExploitation evidence
Disclosed: evidence found.
CVE published 6 Jul 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 9 Nov 2026.
What to do
Upgrade fastapi to 0.138.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewfastapipkg:brew/fastapiOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade to pydantic-settings version 0.138.0 or later, which fixes the vulnerability by restricting directory traversal to paths within secrets_dir, using a single cycle-safe iterator for size checks and loading, and skipping files whose resolved paths escape secrets_dir. If upgrading is not immediately possible, ensure the secrets_dir is fully controlled and not writable by untrusted users or components, or disable secrets_nested_subdir to avoid following symlinks.
Description
A vulnerability in pydantic-settings' NestedSecretsSettingsSource allows symbolic links inside the configured secrets directory to point outside it, causing files outside the intended directory to be read into application settings. This also bypasses the configured maximum size limit for secrets directories, potentially leading to excessive resource usage. The issue affects versions >=0.126.0 and <0.138.0 and is fixed in version 0.138.0.