semgrep · pydantic-settings: NestedSecretsSettingsSource follows symlinks outside secrets_dir, enabling local file read and
Affects semgrepSource GCVE Database
Not known to be exploited · CVSS 5.3 Medium : upgrade to 1.168.0 when convenient.
Data as of 31 Oct 2026, 16:22 UTC
- Patch
- Available – fixed in 1.168.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 30 Oct 2026.
What to do
Upgrade semgrep to 1.168.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewsemgreppkg:brew/semgrepOther 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 1.168.0 or later, which fixes the issue by restricting directory traversal to paths within the configured secrets_dir and using a consistent, cycle-safe iterator for size checking and loading. If upgrading is not immediately possible, ensure that the configured secrets_dir is fully controlled and not writable by untrusted users or components, or disable the secrets_nested_subdir option to avoid following symlinks.
Description
The pydantic-settings library's NestedSecretsSettingsSource component improperly follows symbolic links inside a configured secrets directory that point outside this directory, allowing local files outside the intended secrets directory to be read into application settings. This behavior also bypasses the configured maximum size limit for secrets loading, potentially leading to excessive resource consumption. The vulnerability requires the ability to place symlinks inside the secrets directory and is not remotely exploitable on its own. It affects versions from 1.143.0 up to but not including 1.168.0. A fix is available in version 1.168.0.