The mongos killCursors command handler authorizes the killAnyCursor action against the client supplied request namespace from the killCursor command, instead of the cursor's actual associated namespace. This means that an authenticated user with killAnyCursor on one database can kill cursors belonging to a different database. Note that is only affects mongos only.
Root cause
cluster_killcursors_cmd.cpp builds an authChecker lambda capturing the nss from the killCursors command BSON and passes it to auth::checkAuthForKillCursors, which checks for killAnyCursor against that namespace. The cluster cursor manager looks up that cursor by cursorId only and the auth callback received just the user, never the cursors stored namespace. Note that the mongod is correct, it uses the namespace from the cursor to perform the authentication.