- CVE-2020-1350: Wormable Remote Code Execution Vulnerability in Windows DNS Server Disclosed (SIGRed)
- Background
- Analysis
- Proof of concept
- Solution
- Identifying affected systems
- Get more information
- Satnam Narang
- Windows dns server remote code
- Asked by:
- General discussion
- Обнаружена опаснейшая уязвимость в Windows DNS Server
- Детали
- Исправление
CVE-2020-1350: Wormable Remote Code Execution Vulnerability in Windows DNS Server Disclosed (SIGRed)
Researchers disclose a 17-year-old wormable flaw in Windows DNS servers. Organizations are strongly encouraged to apply patches as soon as possible.
Update July 17, 2020: The Proof of Concept and Solutions sections have been updated to reflect the availability of proof of concept scripts and the availability of an audit file for Tenable products.
Background
On July 14, Microsoft patched a critical vulnerability in Windows Domain Name System (DNS) Server as part of Patch Tuesday for July 2020. The vulnerability was disclosed to Microsoft by Sagi Tzadik and Eyal Itkin, researchers at Check Point Research, who dubbed this vulnerability “SIGRed.” According to the researchers, the vulnerability has persisted in Windows DNS Server for 17 years. Microsoft has published its own blog post about the flaw, warning that they consider it wormable.
Analysis
CVE-2020-1350 is a critical remote code execution (RCE) vulnerability in Windows DNS servers due to the improper handling of DNS requests. It was assigned a CVSSv3 score of 10.0, the highest possible score. To exploit this vulnerability, an attacker would send a malicious request to a vulnerable Windows DNS server. Successful exploitation would grant the attacker arbitrary code execution privileges under the Local System Account context. Microsoft warns that systems at risk include “Windows servers” that have been “configured as DNS servers.”
Second major wormable flaw patched this year
In March of this year, Microsoft released patches for CVE-2020-0796, a wormable RCE vulnerability in Microsoft Server Message Block 3.1.1, known as EternalDarkness or SMBGhost. While we have yet to see SMBGhost used in a wormable fashion, SIGRed marks the second wormable Microsoft vulnerability patched this year.
SIGRed can be triggered via the browser
Researchers at Check Point found that they could remotely trigger the vulnerability through a web browser. This is achieved by “smuggling” a DNS query in an HTTP request as part of the POST data. However, this vulnerability can only be exploited through browsers that accept HTTP requests over the standard DNS port (53), which include Internet Explorer and Microsoft Edge versions that are not using Chromium.
As part of a demonstration, Check Point Researchers show how they could trigger the vulnerability by sending a link to a user in an email, which when opened would smuggle the DNS query inside of the HTTP request.
Proof of concept
At the time this blog post was published, there was no working proof-of-concept (PoC) code available for this vulnerability. However, we have seen at least one fake PoC that RickRolls users. In the past, we’ve also observed some malicious scripts that masquerade as PoCs being published to GitHub. We strongly advise caution when dealing with alleged PoCs.
Since CVE-2020-1350 was made public on July 14, PoCs have been published to GitHub including scripts to apply the mitigation instructions listed in the Solutions section, as well as a few scripts [1, 2] that exploit the flaw in order to cause a denial of service.
Solution
Microsoft has released patches to address SIGRed across a variety of Windows Server releases. Despite Windows Server 2008 reaching end of life in January 2020, Microsoft has published security patches to prevent unsupported systems from being compromised by a potential worm.
Tenable strongly encourages organizations to apply these patches as soon as possible.
Article | Products | KB |
---|---|---|
4565536 | Windows Server 2008 for 32-bit Systems Service Pack 2 Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core) Windows Server 2008 for x64-based Systems Service Pack 2 Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core) | KB4565536 |
4565529 | Windows Server 2008 for 32-bit Systems Service Pack 2 Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core) Windows Server 2008 for x64-based Systems Service Pack 2 Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core) | KB4565529 |
4565524 | Windows Server 2008 R2 for x64-based Systems Service Pack 1 Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core) | KB4565524 |
4565539 | Windows Server 2008 R2 for x64-based Systems Service Pack 1 Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core) | KB4565539 |
4565537 | Windows Server 2012 Windows Server 2012 (Server Core) | KB4565537 |
4565535 | Windows Server 2012 Windows Server 2012 (Server Core) | KB4565535 |
4565541 | Windows Server 2012 R2 Windows Server 2012 R2 (Server Core) | KB4565541 |
4565540 | Windows Server 2012 R2 Windows Server 2012 R2 (Server Core) | KB4565540 |
4565511 | Windows Server 2016 Windows Server 2016 (Server Core) | KB4565511 |
4558998 | Windows Server 2019 Windows Server 2019 (Server Core) | KB4558998 |
4565483 | Windows Server, version 1903 (Server Core) Windows Server, version 1909 (Server Core) | KB4565483 |
4565503 | Windows Server, version 2004 (Server Core) | KB4565503 |
If applying these patches is not currently feasible, Microsoft provided a workaround via a Windows registry modification:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
DWORD = TcpReceivePacketSize
Value = 0xFF00
In order for these changes to take effect, the DNS Service must be restarted.
Microsoft recommends removing the workaround after patches have been applied.
On July 17, our Audit and Compliance team released an audit file for Tenable products that will detect whether or not the mitigation has been applied to assets.
When a target is scanned, it will produce the following result:
If the registry modification has been applied, it will return a “PASSED” value under the compliance tab, otherwise it will return a “FAILED” value.
Identifying affected systems
A list of Tenable plugins to identify this vulnerability will appear here as they’re released.
Get more information
Learn more about Tenable, the first Cyber Exposure platform for holistic management of your modern attack surface.
Get a free 30-day trial of Tenable.io Vulnerability Management.
Satnam Narang
Satnam joined Tenable in 2018 as a Senior Security Response Manager. He has over 15 years experience in the industry (M86 Security and Symantec). He contributed to the Anti-Phishing Working Group, helped develop a Social Networking Guide for the National Cyber Security Alliance, uncovered a huge spam botnet on Twitter and was the first to report on spam bots on Tinder. He’s appeared on NBC Nightly News, Entertainment Tonight, Bloomberg West, and the Why Oh Why podcast.
Interests outside of work: Satnam writes poetry and makes hip-hop music. He enjoys live music, spending time with his three nieces, football and basketball, Bollywood movies and music and Grogu (Baby Yoda).
Windows dns server remote code
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
General discussion
An attacker can exploit this vulnerability by sending a specially crafted name request to a Microsoft DNS Server that would trigger it to send a recursive request to a malicious upstream DNS server, that would then reply with the exploit payload. The RCE vulnerability does not require authentication and is considered wormable for Microsoft DNS Servers configured as recursive resolvers.
Microsoft DNS Servers that are configured as recursive resolvers present the highest risk; however, this configuration alone will not fully mitigate the vulnerability.
Microsoft strongly recommends that server administrators immediately apply security updates otherwise registry workarounds as follows:
Set TcpReceivePacketSize = 0xFF00 and restart the DNS Server Service.
If unable to install preventative fixes released July 14, 2020, OR your DNS Server is not currently supported, immediately implement the following Workaround on all Microsoft DNS Servers:
The following registry modification restricts the size of the largest inbound TCP based DNS response packet allowed and has been identified as a workaround for this vulnerability.
Обнаружена опаснейшая уязвимость в Windows DNS Server
Исследователи в области кибербезопасности из компании Check Point раскрыли новую критическую уязвимость, которая затрагивает версии Windows Server 2003–2019 с оценкой критичности 10 из 10 по шкале CVSS.
17-летний программный недостаток приводит к удаленному выполнению кода (CVE-2020-1350), названному Check Point «SigRed» и может позволить удаленному злоумышленнику, не прошедшему проверку подлинности, получить права администратора домена над целевыми серверами и получить полный контроль над ИТ-инфраструктурой организации.
Атакующий может использовать уязвимость SigRed, отправляя специально созданные вредоносные DNS-запросы на DNS-сервер Windows и выполнять произвольный код, позволяя хакеру перехватывать и обрабатывать электронные письма пользователей и сетевой трафик, собирать учетные данные пользователей и многое другое.
В отчете, опубликованном в блоге компании, исследователь Check Point Саги Цадик подтвердил, что этот недостаток имеет ужасный характер, позволяя атакующим начать атаку, которая может распространиться с одного уязвимого компьютера на другой без какого-либо вмешательства человека. Т.е. уязвимость носит явный «wormable»-характер.
После того, как Check Point ответственно сообщила о своих выводах Microsoft, производитель Windows подготовил исправление для этой уязвимости и выпустил его, начиная с сегодняшнего дня, в рамках своего июльского исправления во вторник, которое также включает в себя обновления безопасности для 122 других уязвимостей.
В Microsoft заявили, что не нашли никаких доказательств того, что эта ошибка активно использовалась злоумышленниками, и посоветовали пользователям немедленно устанавливать исправления.
«Windows DNS Server — это основной сетевой компонент. Хотя в настоящее время неизвестно, чтобы эта уязвимость использовалась в активных атаках, важно, чтобы клиенты применяли обновления Windows для ее устранения как можно скорее».
Детали
Переадресованный запрос происходит, когда DNS-сервер не может разрешить IP-адрес для данного доменного имени (например, www.google.com ), в результате чего запрос перенаправляется на официальный DNS-сервер имен (NS).
Чтобы использовать эту архитектуру, SigRed включает в себя настройку записей ресурсов NS домена («deadbeef.fun») для указания на вредоносный сервер имен («ns1.41414141.club») и запрос целевого DNS-сервера для домена, чтобы последний анализировал ответы от сервера имен для всех последующих запросов, связанных с доменом или его поддоменами.
Таким образом злоумышленник может вызвать ошибку целочисленного переполнения в функции, которая анализирует входящие ответы для перенаправленных запросов («dns.exe!SigWireRead»), чтобы отправить ответ DNS, содержащий запись ресурса SIG размером более 64 КБ, и вызвать контролируемое переполнение кучи примерно исходя из небольшого выделенного буфера.
Ошибка выявлена в функции, ответственной за выделение памяти для записи ресурса («RR_AllocateEx»), чтобы генерировать результат размером более 65 535 байт, что вызывает переполнение целых чисел, которое приводит к гораздо меньшему выделению, чем ожидалось.
Но с одним сообщением DNS, ограниченным 512 байтами в UDP (или 4096 байтами, если сервер поддерживает механизмы расширения) и 65 535 байтами в TCP, исследователи обнаружили, что ответа SIG с одной только длинной сигнатурой было недостаточно, чтобы вызвать уязвимость.
Чтобы достичь этого, атака использует преимущества сжатия DNS-имен в ответах DNS, чтобы создать переполнение буфера с использованием вышеупомянутого метода для значительного увеличения размера выделения.
SigRed может быть запущен удаленно через браузер в ограниченных сценариях (например, Internet Explorer и браузеры Microsoft Edge не на основе Chromium), позволяя злоумышленнику злоупотреблять поддержкой DNS-серверов Windows в функциях повторного использования соединений и конвейерной обработки запросов, чтобы «переправить» DNS-запрос внутри полезной нагрузки HTTP-запроса к целевому DNS-серверу при посещении веб-сайта под их контролем.
DNS-клиенты («dnsapi.dll») не подвержены этой ошибке, что заставляет исследователей подозревать, что Microsoft управляет двумя совершенно разными базами кода для DNS-сервера и DNS-клиента и не синхронизирует исправления ошибок между ними.
Исправление
Учитывая серьезность уязвимости и высокие шансы на активную эксплуатацию, пользователям рекомендуется срочно обновить уязвимые DNS-серверы Windows для снижения риска.
В качестве временного обходного пути, максимальная длина сообщения DNS (через TCP) может быть установлена в значение «0xFF00», чтобы исключить вероятность переполнения буфера: