We study the formation of baryons as composed of quarks and diquarks in hot and dense hadronic matter in a Nambu--Jona-Lasinio (NJL)--type model. We first solve the Dyson-Schwinger equation for the diquark propagator and then use this to solve the Dyson-Schwinger equation for the baryon propagator. We find that stable baryon resonances exist only in the phase of broken chiral symmetry. In the chirally symmetric phase, we do not find a pole in the baryon propagator. In the color-superconducting phase, there is a pole, but is has a large decay width. The diquark does not need to be stable in order to form a stable baryon, a feature typical for so-called Borromean states. Varying the strength of the diquark coupling constant, we also find similarities to the properties of an Efimov states.