Government clients are the primary purchasers of Oshkosh's emergency vehicles. Image source: Getty Images.

The outlook for Oshkosh Corporation (OSK 0.05%) is good: the company has many strengths, positive analyst reviews, and solid fundamentals, including a relatively low P/E as compared to peers like PACCAR (PCAR -2.26%) and Caterpillar (CAT -0.55%).

However, even a company with a good outlook can be derailed. And Oshkosh has certain risk factors that could prove problematic for investors. Here are the ones to be most concerned about.

Risk No. 1: The government well runs dry

Although Oshkosh Corporation has many diverse clients for its vehicles, much of its revenue is dependent on government spending. That doesn't just mean the federal government, although at 15% of the company's 2015 revenue, the U.S. government is the company's largest client. The company also sells fire and safety equipment to municipal governments, and other products like garbage trucks and cement mixers to companies that use those machines to work on government contracts.

So if government spending goes down, revenue for Oshkosh could follow. Traditional truck makers like PACCAR don't have that problem.

Of these government-spending-related risks, changes in the U.S. defense budget would probably have the most significant impact on the company. And many things could cause spending by the Department of Defense to drop. Weakness in the U.S. economy, further troop withdrawals from Iraq and Afghanistan, or additional budget sequestration could each have an impact on overall DoD spending. And even if overall spending remains the same or increases, the military could reallocate resources away from tactical wheeled vehicles -- Oshkosh's primary military product -- and into other areas.

Even if federal government spending were to stay the same, if overall municipal spending were to drop due to an economic recession or similar reason, it would likewise have an impact on the company's bottom line. That said, sometimes government spending goes up during a recession. In 2010, for example, during the Great Recession, Oshkosh's revenue actually increased, almost entirely because of federal government contracts, which made up 72% of the company's overall revenue that year.

Risk No. 2: The boom goes bust

Many of the industries in which Oshkosh operates are cyclical, so declines are not only possible, they're expected.

This is particularly true of the defense segment. Until 2013, the company was riding a defense spending boom that began with the invasions of Afghanistan and Iraq in 2001 and 2003, respectively. Such events usually arise quickly and unexpectedly, along with the business they produce for Oshkosh.

But for every boom, there's a bust, and for Oshkosh it was the major troop withdrawals from Iraq in 2011 and from Afghanistan in 2014. With the troops went the need for new trucks, replacement parts, armoring, and other associated goods and services that Oshkosh provided.

But it's not just defense: The company's access equipment market is also highly cyclical, dependent on factors as diverse as housing starts, oil and gas activity, and equipment-rental company consolidation. Broadly, though, the segment is tied to the health of the global economy, which has been recovering very slowly since the 2008 financial crisis.

In fact, the slow recovery has had a negative impact on Oshkosh's sales volume relative to its historical levels in all of its non-defense areas. Lower housing starts are bad enough for Oshkosh on their own, but they also affect municipal tax revenues, which leads to lower sales of garbage trucks and fire trucks. If the recovery continues to be this slow -- or, worse, starts going in reverse -- then Oshkosh will be in big trouble.

However, in a cyclical industry, even bust cycles have an end, and investors can be rewarded for buying a cyclical company near the end of one.

Risk No. 3: A fragmented market

The specialty vehicles market is a fragmented market, with Oshkosh sandwiched between small regional companies on one end and divisions of global giants like Caterpillar on the other.

Oshkosh tries to use its medium size to its advantage by utilizing economy of scale over its smaller competitors, and its flexibility and ability to customize equipment over its larger ones. For the most part, this seems to be working.

But there's no guarantee that it will keep working indefinitely. A larger competitor -- or even a smaller one -- could start manufacturing equipment at a low enough price that even a client wanting a customized option can't say no. A smaller competitor -- or even a larger one -- could successfully develop a new product that cuts into Oshkosh's sales. Consolidation among multiple smaller rivals, or a larger rival buying up smaller players, could create a new entity that more directly competes with Oshkosh across multiple business lines, taking away some of its competitive advantages (and some of its sales).

While there's no indication that any of this is going to happen, product innovation often comes as a surprise, meaning investors might not hear about such a development until it was already upon them.

Investor takeaway

When government spending decisions have as much of an impact on a company as they have on Oshkosh, the stock can be a risky proposition for investors. Fickle political winds can shift at any time, causing a company's prospects to change abruptly. Sometimes, like in the early 2000s, those changes work to the company's advantage; other times, they don't.

However, Oshkosh's management has managed to steer it pretty ably through the ups and downs of the past five years:

OSK Chart

OSK data by YCharts.

That said, investors considering buying Oshkosh stock need to understand the risks. Looking at the above chart, you can see that 2013 and 2016 were great years to own Oshkosh...and 2014 and 2015 were absolutely terrible. Don't consider buying Oshkosh unless you are willing to hang on for the ride.