2005 Legacy automatic sticks in park
Most likely, it's a defective brake-shift solenoid. Normally, you have to press the brake peddle to move the shifter. You'll probably need a mechanic to fix this.
Perhaps an interlock problem. Have a transmission shop look at it.
Search Subaru Legacy Questions
Subaru Legacy Experts