Can I add a junction box in my attic to ease congestion in a ceiling box?
Assuming your attic is accessible via a persistent access panel, that's fine. There's no difference between that and, say, having a light and switch up there.
Just be sure to run the cables in such a way that they aren't prone to damage from foot traffic, and fasten (staple) to code (generally every four feet and within 12&quot; of boxes).
That said, if your box is standard round and 2-1/8&quot; deep you can have five cables coming in. You'd be at max with ten #14 wires, but with a little planning and careful laying-in it would fit.