An efficient GaCl3-catalyzed direct cyanation of indoles and pyrroles using bench-stable electrophilic cyanating agent N-cyanosuccinimide was achieved and afforded 3-cyanoindoles and 2-cyanopyrroles in good yields and excellent regioselectivities. Notably, this protocol exhibited high reactivity for unprotected indoles and was applicable to a broad range of indole and pyrrole substrates.