Not only from purchasing a firearm, but merely possessing a firearm or ammunition is a federal crime according to 18 U.S.C. § 922
And a person doesn't need to have an actual drug charge to be ineligible. Just the fact that they used drugs at any time within the last 12 months makes it a felony to be in
possession of a firearm or ammunition.
"Such use is not limited to the use of drugs on a particular day, or within a matter
of days or weeks before, but rather that the unlawful use has occurred recently enough to
indicate the individual is actively engaged in such conduct. An inference of current use or
possession may be drawn from evidence of a recent use or possession of a controlled
substance or a pattern of use or possession that reasonably covers the present time. The ATF
has determined that the present time is represented by the time frame of within the past 12
months."
https://www.justice.gov/file/1385186/download
"The Gun Control Act (GCA), codified at 18 U.S.C. § 922(g), makes it unlawful for certain categories of persons to ship, transport, receive, or possess firearms or ammunition, to include any person:
who is an unlawful user of or addicted to any controlled substance (as defined in section 102 of the Controlled Substances Act, codified at 21 U.S.C. § 802);"
Identify Prohibited Persons | Bureau of Alcohol, Tobacco, Firearms and Explosives