Arbitrary score/selector/NBT resolution using lectern without operator rights
Start in a world you have operator rights in (e.g: singleplayer world) and run the following command:
/give @s lectern{BlockStateTag:{"has_book":"true"},BlockEntityTag:{Book:{id:"written_book",Count:1,tag:{author:"s",title:"b",pages:["{\"selector\":\"@e[limit=5]\"}"]}}}}
Save the lectern to a toolbar. Enter a world you don't have operator rights on (e.g: a creative multiplayer server). Then load the toolbar and place down the lectern.
The text components targeting entities/scores/nbt will evaluate when placed, allowing you to gain access to information you shouldn't.