"Due to the improper tightening of the securing nuts, the drive shaft may separate from the rear differential," said NHTSA in its recall summary. "It may strike the fuel tank and result in a fuel leak, increasing the risk of a fire."
Subaru told federal safety regulators this could happen "without warning."
Subaru spokesman Michael McHale told Edmunds there are no injuries, accidents, fires or fatalities linked to the recall.
A stop-sale order has been issued on the vehicles until they are repaired.
The affected Legacy sedans were built from October 24, 2015 to November 16, 2015. The affected Outback wagons were built from October 24, 2015 to November 17, 2015.
Subaru said the problem was discovered during a random vehicle inspection at Subaru of Indiana Automotive, Inc.
Subaru dealers will inspect the fastening nuts and tighten or replace them, as necessary.
The recall began on December 10. Owners can contact Subaru customer service at 1-856-488-8500.
Edmunds says: If you own one of these vehicles, contact your Subaru dealer now to make arrangements for the repair.