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.)
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| denji | ngx_cache_purge | 2.4.0 – ≤ 2.5.6, 3.0.0 – < 3.0.4 | 3.0.4 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libnginx-mod-http-cache-purge | 1:3.0.4-1 | — |
| Debian 13 | libnginx-mod-http-cache-purge | No fix yet | — |
| Debian 12 | libnginx-mod-http-cache-purge | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libnginx-mod-http-cache-purge | No fix yet | — |
| Ubuntu 26.04 LTS | libnginx-mod-http-cache-purge | No fix yet | — |
| Ubuntu 24.04 LTS | libnginx-mod-http-cache-purge | No fix yet | — |