Could citing a database like libgen get one into trouble?
The databases are illegal in that they violate copyright law. The owner of the database is clearly in violation of the law, but users of the database are generally not. That said, I can imagine some authors would be upset to see a published link to a pirated version of their book. Why not just go to the library and confirm that the printed version matches the online version.