Cobalt-catalyzed C-H cyanation of (hetero)arenes and 6-arylpurines with N-cyanosuccinimide as a new cyanating agent.