Millions of Americans rushed to finish their taxes in the hours just before the midnight deadline Wednesday. But for business-owners in the cannabis industry, a years-long tax battle is far from over.

Supporters of legal marijuana cited tax revenue as big factor in pushing through laws that have allowed medical marijuana sales in 23 states and recreational pot in four. But the businesses that grow and sell marijuana in those states are also staring at a steep federal tax bill, especially when compared with businesses in other industries.

That’s because of a little-known wrinkle in U.S. tax law that has turned out to be a major problem for pot businesses, even when operating where sales of medical or recreational marijuana are legal under state law. In 1982, Congress enacted Section 280E of the federal Tax Code to prevent drug traffickers from being able to claim business expenses related to illicit dealings on their federal tax returns. (Seriously, lawmakers decided to close the loophole after a drug dealer successfully wrote off travel expenses as well as the cost of a scale for weighing drugs.)

Of course, 280E predates the recent wave of marijuana legalization on a state-level by a couple of decades, but the federal laws outlawing marijuana remain in effect. That leaves marijuana cultivators and dispensary owners across the country in a tricky situation in which they may be operating legally under the laws of their respective states while the federal government — including the Internal Revenue Service — still technically consider them outlaws.

In terms of tax filings, specifically, the legal cannabis industry has failed to adjust 280E since it was enacted. The IRS still does not let pot growers and resellers deduct expenses related to their businesses. That means marijuana business owners are technically barred from claiming even the most basic of tax exemptions enjoyed by the rest of the corporate world: from advertising costs to most employees’ salaries.

As a result, many marijuana business owners end up paying effective tax rates of anywhere from 40% to 70%, according to Derek Peterson, the CEO of Terra Tech, a publicly-traded company that produces marijuana extracts and also has plans to open a handful of dispensaries in Nevada. Others in the industry have said business-owners face effective tax rates as high as 90%. That is compared to the typical corporate tax rate of around 35%, though many large, multinational companies in the U.S. reportedly pay closer to 12.5%.

Marijuana entrepreneurs are already burdened by a lack of banking options in the industry, because of large banks being nervous about federal prohibition laws, Peterson added. “The overhead is significant when you start to layer on all of these extra headwinds that entrepreneurs in this space have to tackle that normal business owners don’t necessarily have to deal with,” he told Fortune.

Hank Levy, an Oakland, Calif.-based accountant who said he files a few hundred tax returns for marijuana clients each year, sees the high tax rates in the industry as a major roadblock to business growth. “We’re making adjustments of hundreds of thousands of dollars on clients’ tax returns,” he said, adding that such an amount can take a huge chunk out of most small companies’ profits. The tax burden has driven some dispensaries out of business, he said.

For nearly a decade, though, the cannabis industry has managed to work around 280E, to some degree, by taking advantage of a 2007 federal tax court ruling saying that marijuana businesses can still claim deductions for the cost of goods sold — aka the pot, go figure — as well as for expenses they incur performing any service that doesn’t qualify as drug-trafficking. In some cases, dispensaries have used that ruling to deduct a portion of the salaries paid to employees who spend part of their time on educational services such as counseling customers on the different types of cannabis strains present in a store and the effects of each.

The industry has previously included a variety of activities under the category of cost of goods sold, including the amount paid by resellers to cultivators for a fresh batch of marijuana as well as the cost of transporting the drugs from a growing facility to a retail location. Businesses have also deducted the cost of salaries for employees who spend their time packaging the marijuana for sale, or even storing it and cleaning up a facility. Basically, any salary that doesn’t cover actually ringing up grams of weed and handing them over to customers in exchange for payment.

But, a memo issued by the IRS in January — one of the few times the agency has offered any clarification on 280E — seems to have significantly narrowed the scope of what expenses fall under the category of cost of goods sold, further pressuring marijuana business-owners already facing steep tax bills. The IRS memo lets growing facilities include the cost of seeds or plants as well as labor related to the cultivation process, but the memo hits retailers harder by disallowing the deduction of general administrative costs as well as costs associated with handling and storing marijuana.

Henry Wykowski, an attorney in San Francisco who represents roughly 100 cannabis industry clients across the country and a former Justice Department prosecutor, views the IRS memo as the latest attempt by the agency to limit the deductible options for pot businesses filing tax returns. But he also anticipates the IRS rules ultimately leading to a decision in U.S. Tax Court. “I think it’s something that’s going to be tested in court,” said Wykowski, who has handled more than five dozen IRS audit appeals and he was the lead attorney working on the 2007 federal tax case that established the standard for how the pot industry currently calculates its tax deductions.

Still, for Wykowski and the accountant Levy, who have both spent years walking their marijuana industry clients through the complicated U.S. tax rules, the January IRS memo further muddied the picture for businesses trying to mitigate their 280E tax burden while avoiding the audit process. “It’s really creating a lot of scrambling on the technical front trying to figure this out,” Levy said.

So, why does the IRS refuse to exempt businesses operating legally under state law from 280E? Some in the industry believe the IRS is wary of wading into the murky waters of marijuana politics by taking a stance on the tax issue even though U.S. Attorney General Eric Holder has allowed states to operate legal marijuana markets without federal interference. For Levy, though, it is a matter of revenue. “I think they’re like a shark that smells blood. They see money and they’re going after it,” Levy said.

The IRS did not immediately respond to Fortune‘s request for comment about 280E.

Terra Tech’s Peterson sees the tax issue as something that is impeding the marijuana industry’s growth at a time when it is attempting to shift “from the black market to the open market.” It is progress he thinks the government should support. “The industry will collapse on itself over time if these adjustments [to 280E] aren’t made,” Peterson said.

Michael Kosnitzky, a tax partner at the law firm Boies, Schiller & Flexner in New York, told Fortune he would be interested in challenging the IRS’ position by corralling a group of audited marijuana businesses and mounting a legal challenge that could force Congress to change 280E. The recent IRS memo pertaining to Section 280E creates an “unconstitutional burden” on the cannabis industry, Kosnitzky said, by effectively subjecting medical and recreational marijuana businesses operating legally under state law to a different set of tax rules than those that apply to legal businesses in other industries. His firm already has some success in overturning state laws by taking a lead role in overturning California’s same-sex marriage ban.

Meanwhile, Wykowski also serves as counsel to the National Cannabis Industry Association, which has made several pushes for federal lawmakers to tweak the tax code. He said one sure way to remove the industry’s tax hurdles would be to redesignate marijuana’s classification as a dangerous Schedule I drug ( 280E applies to Schedule I and Schedule II drugs). A current bipartisan bill sitting before Congress, the CARERS Act, would reschedule marijuana, but only to Schedule II.

Until that happens, Wykowski said, there is likely to be an uptick in IRS audits of marijuana businesses in coming years. As the wave of new businesses start opening in states where the drug was recently legalized, he said, they will have a year before they have to file a tax return and then it can take a couple of years before a return is selected for an audit. “We’re ready,” Wykowski said.

For more about the marijuana industry, watch this Fortune video: