In a skillet or Dutch oven, heat the oil over medium heat. Add the leeks, sprinkle with salt and cook, stirring constantly, until soft but not browned, about 5 minutes.
Add the rice to the pan and stir to coat. Add the wine and cook, stirring constantly, until absorbed. Stir in the squash and thyme. Add 1 cup broth and cook, stirring constantly, until completely absorbed. Continue adding the broth 1 cup at a time, cooking and stirring until the rice is al dente but cooked through, about 25 minutes (the risotto should be slightly soupy but not runny).
Stir in the cheese and cayenne and season with black pepper.