P0345 on 2004-2008 Subaru Forester XT: Camshaft Sensor (Bank 2) Causes and Fixes
P0345 on a Forester XT most often points to a failed driver's side intake camshaft position sensor. Before replacing it, check the wiring and connector for damage or oil contamination. A stretched or jumped timing belt is another serious and common cause that must be investigated immediately, as this is an interference engine. Also, consider checking for clogged AVCS banjo bolt filters, a known issue on these engines.
- P0345 on a Forester XT refers specifically to the intake camshaft sensor on the driver's side.
- The most common fix is replacing the sensor, but you must inspect the wiring and connector first.
- Crucially, you must verify the engine's timing belt has not stretched or jumped, as this is a common and serious cause for this code on the EJ255 engine.
- Use high-quality OEM or equivalent branded sensors, as these engines are known to be sensitive to aftermarket parts.
- If you also have P0340 (Bank 1) and/or P0335 (Crank sensor) codes, the problem is almost certainly the timing belt or a major electrical fault, not multiple failed sensors.
What's Unique About the 2003-2008 Subaru Forester

The EJ255 engine in your Forester XT uses an Active Valve Control System (AVCS), which means it has four camshaft position sensors—one for the intake and one for the exhaust cam on each head. This code specifically points to the intake sensor on the driver's side. A critical point for this engine is its use of a timing belt; if it stretches or jumps a tooth, it will cause this code and can lead to severe engine damage because it is an interference engine. Furthermore, the oil lines feeding the AVCS system have small mesh filters in the banjo bolts which are known to clog, starving parts of the valvetrain of oil and potentially causing timing-related codes.
Generation note: This guide covers the second generation (SG) Forester, specifically the turbocharged XT model which was introduced in 2004 and used the EJ255 engine through 2008.
Symptoms You May Notice
- Check Engine Light is on
- Difficulty starting the engine, or it cranks but won't start
- Engine stalling, especially at idle or when coming to a stop
- Rough idling and engine misfires
- Noticeable loss of engine power and hesitation during acceleration
- Reduced fuel economy
- Engine running in a limp mode with reduced performance
- Replacing the camshaft position sensor without first checking the timing belt alignment. If the belt has jumped a tooth, a new sensor will not fix the problem and the code will return immediately.
- Replacing only the sensor when the wiring harness connector is full of oil from a valve cover leak or has corroded terminals.
- Using a cheap, low-quality aftermarket sensor. These are notoriously unreliable in Subarus and may fail within a short period or not work at all.
- Ignoring related codes like P0011/P0021, which point more directly to an AVCS system problem (clogged banjo filter, bad solenoid) rather than the sensor itself.
Most Likely Causes

- Failed Camshaft Position Sensor (Bank 2 Intake) 🔴 High Probability Sensors are exposed to extreme heat cycles at the back of the engine and can fail with age. Subaru forums frequently note that these engines are sensitive to sensor quality, and cheap aftermarket parts may fail prematurely or be dead-on-arrival.
How to confirm: After visually inspecting the wiring, the sensor can be tested with a multimeter for resistance; a good sensor should read between 1-4 kΩ. A more definitive test is to swap it with the identical sensor from the passenger side (Bank 1, P0340). If the code changes to P0340 after clearing codes and running the engine, the sensor is faulty.
Typical fix: Replace the faulty camshaft position sensor. It is highly recommended to use an OEM Subaru part or a high-quality brand like Denso or Hitachi to ensure longevity and proper function. 🎬 Watch: Full tutorial on replacing Subaru cam and crank sensors.
Est. part cost: $90-$160 - Stretched or Jumped Timing Belt 🟡 Medium Probability The EJ255 is an interference engine with a timing belt that has a 105,000-mile replacement interval. A worn tensioner, failing idler pulley, or an old belt can allow the timing to jump one or more teeth, causing the cam and crank signals to de-synchronize. This is a very common failure mode on high-mileage EJs.
How to confirm: Visually inspect the timing belt by removing the outer timing covers (driver's side, center, and passenger's side). Check for slack, damage (fraying, glazing, missing teeth), and verify that all timing marks on the camshaft sprockets and crankshaft sprocket align perfectly with the marks on the engine block/rear timing cover.
Typical fix: If the timing has jumped, a full timing belt service is required. This must include a new belt, a new hydraulic tensioner, and all idler pulleys. It's also wise to replace the water pump and thermostat at the same time. If the belt broke or jumped significantly, a compression test is needed to check for bent valves.
Est. part cost: $250-$500 for a complete, high-quality kit - Damaged Wiring or Corroded Connector 🟡 Medium Probability The sensor is located on the back of the driver's side cylinder head, and its wiring is susceptible to heat-induced brittleness, oil contamination from leaky valve covers, or physical damage during other repairs.
How to confirm: Visually inspect the wiring harness leading to the sensor for any signs of cracking, melting, or frayed wires. Unplug the connector and check for corrosion, bent pins, or oil inside the terminals. A multimeter can be used to check for continuity from the sensor connector to the ECM.
Typical fix: Repair the damaged section of the harness with new wire and heat-shrink tubing. Clean oily or corroded connector terminals with electrical contact cleaner. If the connector housing is broken, it will need to be replaced.
Est. part cost: $10-$50 for wiring repair supplies
Rare But Worth Checking
- Clogged AVCS Banjo Bolt Filter: The oil control solenoid (part of the AVCS) is fed oil through a banjo bolt that contains a small mesh filter. Sludge or debris can clog this filter, restricting oil flow and causing the camshaft to respond slowly or not at all to the ECM's commands. This can trigger timing correlation codes like P0345. Many owners and shops recommend removing these filters as preventative maintenance.
- Failing AVCS Solenoid (Oil Control Valve): The AVCS solenoid itself can fail electrically or become stuck mechanically due to oil sludge. This prevents proper camshaft timing adjustment, which the ECM can interpret as a sensor fault. This is often seen with codes P0011 or P0021 as well.
- Failing Starter Motor or Weak Battery: A weak starter or battery can cause a significant voltage drop during cranking. This can create electrical 'noise' that interferes with the sensitive signals from the cam and crank sensors, sometimes setting false codes before the engine even starts.
- Faulty Crankshaft Position Sensor: The ECM compares signals from both the camshaft and crankshaft sensors to verify engine timing. A failing or intermittent crankshaft sensor can provide a bad reference signal, causing the ECM to incorrectly flag the camshaft sensor's signal as faulty.
Diagnosis Steps
- Read the code with an OBD-II scanner to confirm P0345 is present.
- Note any other codes. P0340, P0335, P0021, or P0011 are critical clues.
- Locate the Bank 2 (driver's side) intake camshaft position sensor. It is on the rear of the cylinder head. For access, you will likely need to remove the battery and windshield washer fluid reservoir.
- Carefully inspect the sensor's electrical connector and wiring harness for any signs of damage, melting, oil saturation, or corrosion.
- Diagnostic Swap: If wiring looks good, swap the driver's side intake cam sensor (P0345) with the passenger's side intake cam sensor (P0340). They are identical parts. Clear the codes and run the engine. If the code returns as P0340, you have confirmed a bad sensor. If P0345 returns, the sensor is likely good and the problem is elsewhere.
- Timing Belt Inspection: If the sensor is not the cause, you MUST inspect the engine's timing. Remove the three plastic timing belt covers. Rotate the engine by hand (using the crankshaft bolt) and verify that all timing marks on the cam and crank sprockets align perfectly with the notches on the rear cover/engine case. 🎬 See how to properly inspect your EJ25 timing belt alignment.
- Check AVCS System: If timing is correct, investigate the AVCS system. Locate and inspect the banjo bolt filter for the Bank 2 oil control valve. Check for sludge or debris. Many owners proactively remove it. 🎬 Watch: How to locate and remove the AVCS banjo filters.
- Check Electricals: If all else is good, check for voltage drop during cranking to rule out a weak battery or starter creating electrical interference.
- If all else fails, the issue could be a rare failure of the Engine Control Module (ECM) or a damaged reluctor wheel on the camshaft itself.
Parts You'll Likely Need

- Camshaft Position Sensor (Bank 2, Intake)
(OEM #22056AA140)— This is the most common component to fail for this specific code. Note: The intake and exhaust sensors on one bank are different, but the intake sensors for Bank 1 and Bank 2 are the same part. Always verify with your VIN.
Related Codes That Often Appear With This One
- P0340 — This is the identical code for the Bank 1 (passenger side) intake camshaft sensor. Seeing both P0340 and P0345 together strongly suggests a systemic problem affecting both banks, such as a jumped timing belt or a major electrical issue, not two simultaneously failed sensors.
- P0335 — This code is for the Crankshaft Position Sensor. When seen with P0345, it points towards a critical timing belt issue or a widespread electrical problem, as it's highly unlikely for both sensors to fail at the exact same time.
- P0011 / P0021 — These codes mean "'A' Camshaft Position - Timing Over-Advanced or System Performance (Bank 1 / Bank 2)". If you see P0345 along with P0021, it strongly suggests the root cause is not the sensor itself, but a mechanical issue with the AVCS system, such as a clogged banjo bolt filter or a failing oil control solenoid.
Technical Service Bulletins (TSBs) & Recalls
- TSB #11-81-07: Addresses P0340/P0345 codes related to incorrect sensor air gap after cam replacement on 2004-2006 turbo models.
- Bulletin #11-130-13R: Provides inspection and repair procedures for intake and exhaust camshaft issues that cause difficulty starting, rough idle, and cam position codes including P0345.
- Bulletin #11-100-11R: Notes that P0345 can be associated with difficulty starting and rough idle symptoms.
Platform-Specific Known Issues
- An early Technical Service Bulletin (TSB #11-81-07) noted that for 2004-2006 turbo models, codes P0340 or P0345 could appear if the air gap between the sensor and camshaft was out of spec, particularly after a camshaft replacement.
- Clogged banjo bolt filters in the AVCS and turbo oil feed lines are a notorious issue. Debris from a failing turbo or engine sludge can block these screens, leading to oil starvation for the AVCS gear or the turbo itself. Many owners remove the filters entirely as a preventative measure.
Mechanic-Grade Diagnostic Values
- Camshaft Position Sensor Internal Resistance — expected: 1-4 kΩ (kilo-ohms). Failure: A reading outside this range, or an open/infinite reading, indicates a failed sensor.
- Camshaft Position Sensor Supply Voltage (at connector, key on, engine off) — expected: ~5V DC on one pin, Ground on another, Signal on the third.. Failure: No voltage or significantly lower voltage suggests a wiring issue from the ECM or a faulty ECM.
- AVCS Oil Control Solenoid (OCV) Voltage (at connector, ignition on) — expected: One pin should show a constant +12V.. Failure: No voltage indicates a wiring or fuse issue upstream of the solenoid.
- AVCS Oil Control Solenoid (OCV) Resistance — expected: Approximately 7-8 Ohms.. Failure: A significantly different reading, or an open/short circuit, indicates a failed solenoid.
Scan Tool Commands That Help
- Subaru Select Monitor (SSM) or compatible high-end scanner (e.g., RomRaider): AVCS Solenoid Duty Cycle / Activation Test — To directly test the functionality of the Bank 2 AVCS solenoid (Oil Control Valve). The scan tool can command the solenoid to activate, and you should hear a corresponding click from the engine. This helps differentiate between a failed solenoid, a wiring issue, or a mechanical blockage (like a clogged banjo filter).
- Subaru Select Monitor (SSM) or compatible high-end scanner: Live Data Monitoring: 'AVCS Advance Angle L' vs 'AVCS Advance Angle R' — After confirming the sensor and solenoid are electrically okay, monitoring the requested vs. actual cam advance angle for both banks while driving can reveal a mechanical problem. If Bank 2's angle (L) lags or doesn't respond compared to Bank 1 (R), it points to an oil flow issue (clogged filter/passage) or a problem with the cam gear itself.
Wiring & Ground Locations

- Engine Harness Main Ground — Typically bolted to the top of the intake manifold, near the throttle body.. A loose or corroded main engine ground can introduce electrical noise and unstable voltages to all engine sensors, including the camshaft position sensors, leading to intermittent and false codes.
- Camshaft Position Sensor Connector (Bank 2) — On the rear of the driver's side (Bank 2) cylinder head, below the intake manifold runner. Access requires removing the battery and washer fluid reservoir.. This is the direct connection point for the sensor. It is a common failure point due to oil leaks from the valve cover gasket above it, which contaminates the pins, and heat exposure which makes the plastic brittle.
Real Owner Repair Stories
- NASIOC forum user (2004 Subaru Forester XT, mileage not specified) — Car suddenly died while driving, would crank but not start. Threw codes P0345, P0340, and P0335.
❌ Tried (didn't work) Initially suspected sensor failure due to multiple codes.
✅ What actually fixed it The timing belt had jumped several teeth. The combination of crank and both cam sensor codes (P0335, P0340, P0345) was the key indicator that it was a global timing issue, not individual sensor failures. A full timing belt job, including a new belt, tensioner, and idlers, resolved the issue. The engine was confirmed to have no bent valves via a compression test. - SubaruForester.org forum user (2005 Subaru Forester XT) — P0345 code, rough running.
❌ Tried (didn't work) Replacing the camshaft position sensor with an aftermarket part did not fix the code.
✅ What actually fixed it The user removed the banjo bolt for the Bank 2 AVCS oil line and found the tiny mesh filter inside was completely clogged with sludge. After removing the filter and cleaning the banjo bolt, the code was cleared and did not return. The user also proactively removed the filter from the Bank 1 banjo bolt.
OEM Part Supersession History
Not specified in searches→22056AA140— Standard part evolution and consolidation.
Heads up: The part 22056AA140 is specified for the intake camshafts on turbo EJ255 models from 2004-2013. The exhaust camshaft sensor has a different part number. While the intake sensors for Bank 1 and Bank 2 are identical, they are not interchangeable with the exhaust sensors.
Model Year Variations Within This Range
- 2004-2005: These early Forester XTs used an EJ255 engine that was nearly identical to the contemporary WRX STi's EJ257, including the B25 head castings and 8.2:1 compression ratio. This makes them desirable for modification.
- 2006-2008: The EJ255 was revised with new D25 head castings, which had a smaller combustion chamber and a slightly higher compression ratio (8.4:1). These engines also introduced a secondary air injection system for emissions, which adds complexity. While the P0345 diagnosis is the same, the specific cylinder heads and some related components are different from the earlier models.
Diagnostic Flowchart
Other Known Issues on This Vehicle
Issues unrelated to this code that are worth knowing about as an owner of this generation:
- Piston Ringland Failure 🔴 High — Common on tuned vehicles or those driven hard, but can occur on stock engines. Often presents as increased oil consumption.
- Clogged Turbo/AVCS Banjo Bolt Filters 🔴 High — Very common. The mesh filters in the oil feed banjo bolts clog with debris, starving the turbo or AVCS of oil, leading to catastrophic failure.
- Head Gasket Failure 🔴 High — A well-known issue on many EJ series engines, including the EJ255, though less frequent than on its naturally aspirated counterparts. Can cause oil and coolant leaks, externally or internally.
- Excessive Oil Consumption 🟠 Medium — Common across this generation. Can be an early sign of ringland failure or simply due to engine design and wear.
- Turbocharger Failure 🔴 High — Often a direct result of the clogged banjo bolt filter starving the turbo of oil. Can also fail from age and wear, especially on modified vehicles.
Used vs. New Parts: Buying Guide for This Vehicle
When a used part is the smart pick: A used part is generally not recommended for the sensor itself due to its electronic nature and exposure to heat. However, sourcing a used wiring harness pigtail from a junkyard is a smart choice if only your connector is damaged, as it provides an OEM-quality connector and wiring to splice in.
Donor-vehicle mileage cap: roughly under 80000 miles for the part to have meaningful remaining life.
What to inspect on the donor part:
- For a wiring pigtail, ensure the plastic is not brittle or cracked.
- Check that the locking tab on the connector is intact.
- Inspect the wire insulation for flexibility and absence of cracks or heat damage.
- Look for a donor vehicle that does not show signs of major oil leaks around the valve covers.
OEM-only on this vehicle (don't cheap out):
- Camshaft Position Sensor
- Timing Belt Kit (Belt, Tensioner, Idlers)
- AVCS Oil Control Solenoid (OCV)
Aftermarket brands forum-validated for this vehicle:
- Denso (often the OEM supplier)
- Hitachi (often the OEM supplier)
Brands owners have reported issues with on this vehicle:
- Unbranded, "white-box" sensors from online marketplaces are frequently reported on forums as being dead-on-arrival or failing within a few months.
Real Owner Stories
Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.
2004 Subaru Forester XT EJ255
Symptoms: The owner provided a visual guide for locating and replacing the sensor due to the P0345 code, highlighting the difficulty of accessing the sensor behind the battery and washer reservoir.
What fixed it: Replacement of the Bank 2 Camshaft Position Sensor.
Source hint: YouTube.com video by user 'Josh Harris' titled 'Subaru Forester XT Camshaft Position Sensor P0345'
2005-2009 Subaru Legacy GT EJ255
Symptoms: Issues with oil starvation to the AVCS gear and turbo due to debris-clogged screens in the oil feed lines.
What fixed it: Removal of all internal banjo bolt filters in the AVCS and turbo feed lines to ensure proper oil flow.
Source hint: legacygt.com walkthrough titled 'How to Remove All Banjo Filters'
2003-2008 Subaru Forester EJ255 — ~105000 miles
Symptoms: P0345 accompanied by P0340; engine timing de-synchronized.
What fixed it: Full timing belt service including a new belt, hydraulic tensioner, and idler pulleys after the belt jumped teeth.
Source hint: subaruforester.org forum threads discussing P0345 and jumped timing belts
Related OBD-II Codes
Frequently Asked Questions
Is there a TSB for the P0345 code on my 2004-2006 Forester XT?
Can I test the Bank 2 sensor by using the one from the other side of the engine?
What brand of replacement sensor should I use for my EJ255 engine?
Where is the Bank 2 camshaft sensor located on my Forester, and how do I get to it?
Could a problem with my oil system cause a P0345 code?
How often should I be changing the timing belt to avoid codes like P0345?
Helpful Videos
We Have This Part in Stock
The information in this article is provided for general reference and educational purposes only. Vehicle specifications, procedures, and part compatibility can vary by production date, trim level, and region. Always consult your vehicle's factory service manual and verify part numbers before purchasing or performing repairs. Safety-critical components such as airbags, seat belts, and braking systems should be installed by a qualified professional.
- Subaru Forester:
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2003-2008 Subaru Forester
- Symptoms You May Notice
- Most Likely Causes
- Rare But Worth Checking
- Diagnosis Steps
- Parts You'll Likely Need
- Related Codes That Often Appear With This One
- Technical Service Bulletins (TSBs) & Recalls
- Platform-Specific Known Issues
- Mechanic-Grade Diagnostic Values
- Scan Tool Commands That Help
- Wiring & Ground Locations
- Real Owner Repair Stories
- OEM Part Supersession History
- Model Year Variations Within This Range
- Diagnostic Flowchart
- Other Known Issues on This Vehicle
- Used vs. New Parts: Buying Guide for This Vehicle
- Real Owner Stories
- 2004 Subaru Forester XT EJ255
- 2005-2009 Subaru Legacy GT EJ255
- 2003-2008 Subaru Forester EJ255 — ~105000 miles
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off