While the nitrile group is by far the most prevalent one among interstellar molecules, the existence of interstellar dinitriles (molecules containing two $-$CN groups) has recently been proven. Here we report the discovery of two new dinitriles in the cold dense cloud TMC-1 . These newly identified species are malononitrile, CH$_2$(CN)$_2$, and maleonitrile, the $Z$ isomer of NC$-$CH$=$CH$-$CN, which can be seen as the result of substituting two H atoms with two $-$CN groups in methane and ethylene, respectively. These two molecules were detected using data from the ongoing QUIJOTE line survey of TMC-1 that is being carried out with the Yebes\,40m telescope. We derive column densities of 1.8\,times \,1011 $ and 5.1\,times \,1010 $ for malononitrile and maleonitrile, respectively. This means that they are eight and three times less abundant than HCC$-$CH$_2$$-$CN and ($E$)-HCC$-$CH$=$CH$-$CN, respectively, which are analog molecules detected in TMC-1 in which one $-$CN group is converted into a $-$CCH group. This is in line with previous findings in which $-$CCH derivatives are more abundant than the $-$CN counterparts in TMC-1 . We examined the potential chemical pathways to these two dinitriles, and we find that while maleonitrile can be efficiently formed through the reaction of CN with CH$_2$CHCN, the formation of malononitrile is not clear because the neutral-neutral reactions that could potentially form it are not feasible under the physical conditions of TMC-1