{"vuid":"VU#576779","idnumber":"576779","name":"Netgear httpd upgrade_check.cgi stack buffer overflow","keywords":null,"overview":"### Overview\r\nMultiple Netgear devices contain a stack buffer overflow in the httpd web server's handling of <tt>upgrade_check.cgi</tt>, which may allow for unauthenticated remote code execution with root privileges.\r\n\r\n### Description\r\nMany Netgear devices contain an embedded web server, which is provided by the <tt>httpd</tt> process, to provide administrative capabilities. On multiple Netgear devices, this code fails to properly validate the header size provided to the <tt>upgrade_check.cgi</tt> handler. Despite copying the header to a fixed-size buffer on the stack, the vulnerable code copies an attacker-provided count of bytes from attacker-provided data. This allows for remote code execution by way of stack buffer overflow. This vulnerability is exacerbated by a number of issues:\r\n\r\n1. The <tt>httpd</tt> process runs with root privileges.\r\n2. Stack cookies, which can help prevent exploitation of stack buffer overflows, are not universally used in Netgear devices.\r\n3. Authentication is not required to reach the vulnerable code.\r\n4. The vulnerability occurs before Cross-Site Request Forgery (CSRF) token checking occurs.\r\n5. Target device fingerprinting can occur by visiting the <tt>/currentsetting.htm</tt> page on an affected device.\r\n\r\nExploit code that targets 79 different Netgear devices is [publicly available](https://github.com/grimm-co/NotQuite0DayFriday/tree/master/2020.06.15-netgear).\r\n\r\n### Impact\r\nBy convincing a user to visit a malicious or compromised website, a remote, unauthenticated attacker may be able to execute arbitrary code on a vulnerable device with root privileges.\r\n\r\n### Solution\r\n#### Apply an update\r\nNetgear has [provided updates for several vulnerable devices](https://kb.netgear.com/000061982/Security-Advisory-for-Multiple-Vulnerabilities-on-Some-Routers-Mobile-Routers-Modems-Gateways-and-Extenders).\r\nNote that Netgear does not indicate when devices have reached an end of life (EOL) state. This may make it difficult to determine if a vulnerable device may receive an update in the future.\r\n\r\nThe CERT/CC has made a [spreadsheet](https://docs.google.com/spreadsheets/d/1Tzq97rRisoZwKNQ1pUYE6phwl4LL7KnZxc828n-hXW0/) to more clearly indicate which devices have updates, and which devices may either be receiving an update in the future, or may possibly be unsupported.\r\n\r\nAs outlined in the blog post [It's Time to Retire Your Unsupported Things](https://insights.sei.cmu.edu/cert/2019/10/its-time-to-retire-your-unsupported-things.html), you should factor the vendor's support life span into purchasing decisions. Vendors that indicate how long products will be supported should be preferred over those that do not clearly indicate how long a device will be supported. Similarly, vendors that clearly indicate when a product has reached EOL state should be preferred over vendors that do not.\r\n\r\n### Acknowledgements\r\nThis vulnerability was publicly disclosed by ZDI, who in turn credit d4rkn3ss from VNPT ISC. Additional analysis was provided by GRIMM.\r\n\r\n This document was written by Will Dormann.","clean_desc":null,"impact":null,"resolution":null,"workarounds":null,"sysaffected":null,"thanks":null,"author":null,"public":["https://www.zerodayinitiative.com/advisories/ZDI-20-712/","https://blog.grimm-co.com/2020/06/soho-device-exploitation.html","https://github.com/grimm-co/NotQuite0DayFriday/tree/master/2020.06.15-netgear","https://docs.google.com/spreadsheets/d/1Tzq97rRisoZwKNQ1pUYE6phwl4LL7KnZxc828n-hXW0/"],"cveids":[],"certadvisory":null,"uscerttechnicalalert":null,"datecreated":"2020-06-26T19:20:09.019720Z","publicdate":"2020-06-26T19:20:09.050887Z","datefirstpublished":"2020-06-26T19:20:09.045780Z","dateupdated":"2022-02-28T15:50:27.930832Z","revision":2,"vrda_d1_directreport":null,"vrda_d1_population":null,"vrda_d1_impact":null,"cam_widelyknown":null,"cam_exploitation":null,"cam_internetinfrastructure":null,"cam_population":null,"cam_impact":null,"cam_easeofexploitation":null,"cam_attackeraccessrequired":null,"cam_scorecurrent":null,"cam_scorecurrentwidelyknown":null,"cam_scorecurrentwidelyknownexploited":null,"ipprotocol":null,"cvss_accessvector":null,"cvss_accesscomplexity":null,"cvss_authentication":null,"cvss_confidentialityimpact":null,"cvss_integrityimpact":null,"cvss_availabilityimpact":null,"cvss_exploitablity":null,"cvss_remediationlevel":null,"cvss_reportconfidence":null,"cvss_collateraldamagepotential":null,"cvss_targetdistribution":null,"cvss_securityrequirementscr":null,"cvss_securityrequirementsir":null,"cvss_securityrequirementsar":null,"cvss_basescore":null,"cvss_basevector":null,"cvss_temporalscore":null,"cvss_environmentalscore":null,"cvss_environmentalvector":null,"metric":null,"vulnote":10}