fix(*): fix security vulnerability and database selection
- If two redis clients share the same connection but use different database, both clients might receive error upon set/get data.
- If a client without authentication shares a connection that is authenticated by other clients, this client bypass ACL.
FTI-5839
@outsinre could you add tests?
@outsinre can you also explain security vulnerability? I guess this is somewhat related to connection pooling that can be shared by some other app?
This library supports pool_name:
https://github.com/bungle/lua-resty-session/blob/master/lib/resty/session/redis.lua#L191
So I guess it is just the default pool name generation (which this library does not try to do, it leaves that to either user of this library or the library this library uses for connecting redis)?
To be honest, I don't see any problem with this library. Should we have default pool name generation? Not sure. Should it be part of resty.redis library, why here? Or should it be problem of system that is using this library, in this case Kong?