Can someone explain what the backdoor could do? It's exposing some session token that someone could then use to login an account on some website that used this gem?
Everything in the first line is a diversion to make the code look complicated but realistic. The eval is what the backdoor does, which means it looks at a cookie with some basic encoding, and runs it as ruby code. There’s no authentication or anything here, the backdoor will work for anyone who cares to set that cookie.