The recall affects cars from the 2005 through 2009 model years sold in states where salt is used to clear roads in the winter.
Subaru says in documents filed with the U.S. government that salt can cause the brake lines to rust and leak. If fluid leaks, it could cause longer stopping distances, increasing the risk of a crash.
The documents didn't say if the problem has caused any crashes. Subaru says it is still totaling the number of vehicles affected. The company sold more than 316,000 Legacys and Outbacks from 2006 through 2009, according to Autodata Corp.
Subaru will check the cars for leaks and replace brake lines if necessary.