Well, are you getting BOTH codes after you replaced the sensor because it's not always just the sensor.
After a search I came up with this:
-Water or corrosion in the connector
-Loose terminals in the connector
-Wiring burnt on exhaust components
-Open or short in the wiring due to rubbing on engine components
-Holes in exhaust allowing unmetered oxygen into exhaust system
-Unmetered vacuum leak at the engine
-Bad o2 sensor
I'm going to go with a vac leak. Have you looked underneath from the downpipe back?
Are there any mods on the car?
2002 WRX Sold
2007 WRX Sold
2007 STi totaled
2007 Foz XT sold