In the education literature, it is generally acknowledged that both credit and insurance for students are rationed. In order to provide a rationale for these observations, we present a model with perfectly competitive banks and risk averse students who have private information on their ability to learn and can decide to default on debt. We show that the combination of ex-post moral hazard and adverse selection produces credit market rationing when default penalties are low. When default penalties increase, the level of student risk aversion proves crucial in determining the market outcome. If risk aversion is low, banks offer non-insuring pooling contracts at equilibrium that may result in overinvestment in education. If student risk aversion is high, high ability students are separated and student loan contracts involve a limited amount of insurance.