CVE-2017-20005
NGINX vulnerability analysis and mitigation

Overview

NGINX before version 1.13.6 contains a buffer overflow vulnerability (CVE-2017-20005) that occurs when processing files with years that exceed four digits. This vulnerability is triggered when the autoindex module encounters a file with a modification date in 1969 that causes an integer overflow, or a false modification date far in the future. The vulnerability was discovered by Jamie Landeg-Jones and reported in 2017 (Nginx Ticket, Debian LTS).

Technical details

The vulnerability exists in the ngxgmtime() function where various buffers are allocated with the assumption that there would be no more than 4 year digits. On platforms with 64-bit timet, this assumption doesn't hold true as 64-bit time_t can represent dates with more than 4 digits. The issue occurs when processing negative timestamps or dates far in the future, which can cause buffer overflow due to improper handling of the year field (Nginx Commit). The vulnerability has been assigned a CVSS v3.1 score of 9.8 (CRITICAL) (NetApp Advisory).

Impact

Successful exploitation of this vulnerability could lead to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS). The buffer overflow condition could potentially allow attackers to cause worker process crashes or execute arbitrary code (NetApp Advisory).

Mitigation and workarounds

The vulnerability was fixed in NGINX version 1.13.6 by implementing time truncation to December 31, 9999, and properly handling negative timestamps. The fix ensures that all dates are truncated by ngx_gmtime() to prevent potential buffer overflows while maintaining compatibility with valid dates (Nginx Commit). Users should upgrade to NGINX version 1.13.6 or later to address this vulnerability.

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management