Description
ngx_cache_purge before 3.0.4 can allow file deletion via a symlink attack in certain situations where nginx and a served application (e.g., WordPress) run under the same user account. The attacker must be able to create a symlink inside the cache path. Version 3.0.4 fixes this for the case of a symlink created at an arbitrary earlier time, but does not resolve an applicable TOCTOU race condition. (The ngx_cache_purge module follows symlinks while walking the cache directory tree during purge operations. The module relies on nginx's ngx_walk_tree(), which relies on stat() and therefore follows symlinks.)
Published: 2026-10-12
Score: 3.6 Low
EPSS: n/a
KEV: No
Impact: Unauthorized File Deletion
Action: Immediate Patch
AI Analysis

Impact

ngx_cache_purge before 3.0.4 processes symbolic links in the cache directory while purging. An attacker who can create a symlink inside a configured cache path can cause the module to follow that link and delete the target file. The flaw is a path traversal vulnerability (CWE‑61) that permits arbitrary file deletion when nginx and the served application run under the same user.

Affected Systems

The vulnerability affects denji's ngx_cache_purge module versions 2.4 up to 2.5.6 and any 3.x release prior to 3.0.4. The patch in commit a6da135 was released on the releases/stable‑3.0 branch and is distributed in version 3.0.4. Users of 2.4–2.5.6 must upgrade to 3.x or apply the commit to the two ngx_walk_tree() call sites. The issue is limited to deployments where the cache directory is writable by nginx and the application shares the same user.

Risk and Exploitability

The CVSS score of 3.6 indicates low severity, and no EPSS score is available. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires a local attacker able to write a symlink into a cache directory and having both nginx and the application run under the same privileged user, a configuration that is uncommon in properly segregated environments. Despite the low score, patching remains the recommended action.

Generated by OpenCVE AI on October 12, 2026 at 04:26 UTC.

Remediation

Vendor Solution

Fixed in commit a6da135 (PR #72) on the releases/stable-3.0 branch. 2.4 through 2.5.6 users should upgrade to 3.x, or backport the change to the two ngx_walk_tree() call sites in those versions.


Vendor Workaround

Restrict write access to the cache directories and all of their parent directories to the nginx user only, and do not run nginx and untrusted application code (for example PHP-FPM) as the same user. Remove any symbolic links found inside configured cache paths (find <cache_path> -type l). These measures also limit the similar traversal in nginx's own cache loader, which the fix in the module does not change.


OpenCVE Recommended Actions

  • Upgrade the ngx_cache_purge module to version 3.0.4 or later.
  • If using ngx_cache_purge 2.4‑2.5.6, backport the a6da135 commit to the two ngx_walk_tree() call sites.
  • Restrict write permissions on the cache directories and all parent directories to the nginx user only.
  • Ensure nginx and any served application, such as PHP‑FPM, run under distinct user accounts.
  • Remove any existing symbolic links from configured cache paths.

Generated by OpenCVE AI on October 12, 2026 at 04:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 12 Oct 2026 04:45:00 +0000

Type Values Removed Values Added
Title Symlink‑Based File Deletion via ngx_cache_purge

Mon, 12 Oct 2026 03:00:00 +0000

Type Values Removed Values Added
Description ngx_cache_purge before 3.0.4 can allow file deletion via a symlink attack in certain situations where nginx and a served application (e.g., WordPress) run under the same user account. The attacker must be able to create a symlink inside the cache path. Version 3.0.4 fixes this for the case of a symlink created at an arbitrary earlier time, but does not resolve an applicable TOCTOU race condition. (The ngx_cache_purge module follows symlinks while walking the cache directory tree during purge operations. The module relies on nginx's ngx_walk_tree(), which relies on stat() and therefore follows symlinks.)
Weaknesses CWE-61
References
Metrics cvssV3_1

{'score': 3.6, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-10-12T02:27:15.378Z

Reserved: 2026-10-12T02:27:14.593Z

Link: CVE-2026-108981

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-12T03:17:18.503

Modified: 2026-10-12T03:17:18.503

Link: CVE-2026-108981

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-12T04:30:06Z

Weaknesses
  • CWE-61

    UNIX Symbolic Link (Symlink) Following