问题描述
在 Apache APISIX 2.10.2 之前的版本中,使用 Apache APISIX Ingress Controller 中 $request_uri 变量存在「绕过部分限制」导致路径穿透风险的问题。
在使用 uri-blocker 插件进行测试场景时发现:
$ ./apisix_request.sh "/public-service/public"
Defaulted container "apisix" out of: apisix, wait-etcd (init)
{"data":"public data"}
$ ./apisix_request.sh "/protected-service/protected"
Defaulted container "apisix" out of: apisix, wait-etcd (init)
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>openresty</center>
</body>
</html>
在上述两种场景下,public-service 是可用的,protected-service 则被插件阻止了。后续对上述场景进行验证测试,发现两种情况均能绕过 Uri 的限制。
由于uri-blocker 插件使用 ctx.var.require_uri 变量不当,导致:
-
攻击者可以绕过访问控制限制逻辑,访问本应该禁止的 API;
<

Apache APISIX 在2.10.2之前的版本中,request_uri变量处理不当可能导致路径穿透风险。攻击者可绕过访问控制,访问禁止API。该问题已在2.10.2版本中修复,建议用户升级并检查自定义插件中对request_uri的使用。
最低0.47元/天 解锁文章
837

被折叠的 条评论
为什么被折叠?



