shiro反序列化漏洞可以获取操作系统用户权限,危害颇大。公司存在一些老旧系统,发现存在shiro漏洞,怎么最小成本修复,又不影响系统运行呢!
 
 
 
在shiro程序前面加上一层代理openresty, 配合lua脚本,过滤rememberme cookie,凡是在黑名单的都无法访问返回403
 
 
 
lua脚本shiro-remember.lua
 
 
 
local ngx_req  = ngx.req local strfind = string.find
 
local a = ngx_req.get_headers() local cookie = a.Cookie if cookie then     if strfind(cookie, "rememberMe") then         ngx.exit(403)     end end
 
nginx.conf添加配置
 
access_by_lua_file  lua/shiro-remember.lua;