问题描述
在 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.requir