In a 2- to 3-quart pan over high heat, bring 4 to 6 cups water to a boil.
Cut squash into 1-inch chunks.
Add to boiling water, cover, and simmer until tender when pierced, 12 to 14 minutes.
Drain and mash squash with a potato masher or a mixer.
Meanwhile, cut off and discard tough green tops, root ends, and coarse outer layer of leeks. Split leeks in half lengthwise and rinse well. Thinly slice.
In a 10- to 12-inch frying pan over medium-high heat, combine oil, leeks, and shallots. Stir often, until vegetables are limp, 5 to 7 minutes.