CVE-2026-86861: CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition in pgadmin.org pgAdmin 4
CVE-2026-86861 is a time-of-check to time-of-use (TOCTOU) race condition vulnerability in pgAdmin 4's File Manager save_file endpoint affecting versions before 9.18. The vulnerability allows a symbolic link substitution attack between the access permission check and the file write operation, potentially enabling an attacker with filesystem access to overwrite arbitrary files outside the user's storage directory. The issue was fixed by enforcing kernel-level protection (O_NOFOLLOW) on the file write operation and restricting file permissions to mode 0600.
AI Analysis
Technical Summary
The vulnerability in pgAdmin 4 arises from a TOCTOU race condition in the save_file endpoint of the File Manager. Initially, the requested file path is validated using Filemanager.check_access_permission(), which rejects symbolic links present at that time. However, the subsequent file write operation uses a plain open() call without O_NOFOLLOW protection, allowing an attacker to substitute a symbolic link at the final path component after the check but before the write. This can cause the write to follow the symbolic link and create or overwrite arbitrary files outside the intended storage directory. Exploitation requires the ability to create or replace symbolic links within the user's storage directory, which pgAdmin does not provide via its interface, so filesystem or shared storage access is necessary. The fix routes the write operation through the same O_NOFOLLOW-protected helper used by the upload path, ensuring kernel-enforced refusal of symbolic links at the final path component and setting file permissions to 0600. Intermediate directory component substitution is not addressed by this fix. This vulnerability affects all pgAdmin 4 versions from initial introduction of the containment check up to but not including version 9.18.
Potential Impact
Successful exploitation could allow an attacker with the ability to create or replace symbolic links in the user's storage directory to overwrite arbitrary files on the pgAdmin host with the privileges of the operating system account running pgAdmin. This could lead to integrity violations of files and potentially limited denial of service. However, exploitation requires local or shared filesystem access and precise timing, making it difficult in practice. No confidentiality or availability impact is indicated. The CVSS v3.1 base score is 5.9 (medium severity), reflecting the complexity and limited scope of impact.
Mitigation Recommendations
An official fix is available in pgAdmin 4 version 9.18 and later, which routes the save_file write operation through an O_NOFOLLOW-protected helper to prevent symbolic link following at the final path component. Users should upgrade to version 9.18 or later to remediate this vulnerability. No additional mitigation is required as the fix enforces kernel-level protections and sets restrictive file permissions. Exploitation requires filesystem access to create symbolic links, which pgAdmin does not expose, limiting risk in typical deployments.
CVE-2026-86861: CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition in pgadmin.org pgAdmin 4
Description
CVE-2026-86861 is a time-of-check to time-of-use (TOCTOU) race condition vulnerability in pgAdmin 4's File Manager save_file endpoint affecting versions before 9.18. The vulnerability allows a symbolic link substitution attack between the access permission check and the file write operation, potentially enabling an attacker with filesystem access to overwrite arbitrary files outside the user's storage directory. The issue was fixed by enforcing kernel-level protection (O_NOFOLLOW) on the file write operation and restricting file permissions to mode 0600.
CVSS v3.1
Score 5.9medium
Affected software
pgadmin.org
pgAdmin 4
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in pgAdmin 4 arises from a TOCTOU race condition in the save_file endpoint of the File Manager. Initially, the requested file path is validated using Filemanager.check_access_permission(), which rejects symbolic links present at that time. However, the subsequent file write operation uses a plain open() call without O_NOFOLLOW protection, allowing an attacker to substitute a symbolic link at the final path component after the check but before the write. This can cause the write to follow the symbolic link and create or overwrite arbitrary files outside the intended storage directory. Exploitation requires the ability to create or replace symbolic links within the user's storage directory, which pgAdmin does not provide via its interface, so filesystem or shared storage access is necessary. The fix routes the write operation through the same O_NOFOLLOW-protected helper used by the upload path, ensuring kernel-enforced refusal of symbolic links at the final path component and setting file permissions to 0600. Intermediate directory component substitution is not addressed by this fix. This vulnerability affects all pgAdmin 4 versions from initial introduction of the containment check up to but not including version 9.18.
Potential Impact
Successful exploitation could allow an attacker with the ability to create or replace symbolic links in the user's storage directory to overwrite arbitrary files on the pgAdmin host with the privileges of the operating system account running pgAdmin. This could lead to integrity violations of files and potentially limited denial of service. However, exploitation requires local or shared filesystem access and precise timing, making it difficult in practice. No confidentiality or availability impact is indicated. The CVSS v3.1 base score is 5.9 (medium severity), reflecting the complexity and limited scope of impact.
Mitigation Recommendations
An official fix is available in pgAdmin 4 version 9.18 and later, which routes the save_file write operation through an O_NOFOLLOW-protected helper to prevent symbolic link following at the final path component. Users should upgrade to version 9.18 or later to remediate this vulnerability. No additional mitigation is required as the fix enforces kernel-level protections and sets restrictive file permissions. Exploitation requires filesystem access to create symbolic links, which pgAdmin does not expose, limiting risk in typical deployments.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PostgreSQL
- Date Reserved
- 2026-09-08T15:47:04.229Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6aac405255bf5e2cf5cb238e
Added to database: 09/17/2026, 19:32:34 UTC
Last enriched: 09/17/2026, 19:47:01 UTC
Last updated: 09/17/2026, 19:47:01 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.