An investigation by Sportsmail returned positive samples of cocaine from the County Stand amenities during the Dante Stakes meet last week.
The newspaper commissioned the expose following a series of photos depicting violent brawls during race meetings at Ascot and Goodwood.
The undercover staff were sent to both York and Newbury during popular meets, although both passed off without any major incidents.
At Newbury, 11 'swabs' taken from toilet areas tested positive for cocaine traces - including four tests before the first race had begun.
York's cocaine use seemed to be restricted to the County Stand, the course's most expensive spectator area, where three positive results were taken from the disabled toilets near the champagne lawn. Swabs taken elsewhere on the site were negative.
Security at racecourses has been increased to prevent drug use, with sniffer drugs and 'amnesty bins' now routinely deployed. At York, measures taken to prevent drug-taking include removing toilet lids and increasing stewarding.
The swabs come in a sealed foil packet and turn blue when traces of cocaine are detected.
Disabled toilets are popular for preparing cocaine because they have more space and flat surfaces. Some racecourses have begun using access keys issued only to those with mobility problems, but the facilities at York are still open to any visitor.
York Racecourse's head of marketing James Brennan said the findings were part of a 'wider challenge in society' and that the facility was working hard to discourage recreational drug use.
"York Racecourse was made aware on Sunday of an undercover investigation conducted by the Daily Mail at the course on Thursday 17 May, in relation to the alleged use of drugs by a small minority of racegoers.
"As the Racecourse was not involved in the investigation, it cannot comment on the rigour and therefore the accuracy of the findings.
"York Racecourse has a zero tolerance policy on this matter, so is disappointed that the journalist chose not to report the matter to North Yorkshire Police (who were in attendance at the track), or to any of the 300+ members of the stewarding team.
"The journalist did confirm that she had an enjoyable and safe day at York and that there were no instances of anti-social behaviour; this was true across all three days of the Dante Festival and so was hopefully the experience of the near 40,000 racegoers.
"The investigation acknowledges the presence of proactive measures to combat the problem of drugs in wider society; the presence of sniffer dogs and North Yorkshire Police, the bag searches, participation in the Pace Yourself Plus initiative, as well as monitoring of toilets are all accepted as positive steps.
"Taken at face value, the investigation reports no evidence of drug taking despite widespread testing in either any of the main toilets nor any of the disabled toilets in the Grandstand and Paddock enclosures, where we understand approximately 20 swabs were taken.
"The article chooses to focus on the findings in two of the disabled toilets within the County Stand area. It is accepted that the obvious privacy expected in toilets makes them a hard area to supervise; this is particularly the case with disabled facilities where there is no public area.
"On a balanced judgement between speed of access versus the potential for abuse, the racecourse had previously decided that these specific disabled toilets should not be operated only by a special key (known as a Radar key). However given the zero tolerance policy, these Radar locks will now be fitted to these toilets.
"The issue of drugs is a major concern for society as a whole, racecourses as with other venues are part of that wider society, not separate to it.
"York Racecourse remains committed to offering an enjoyable and safe experience to all its customers and does not condone the choice of a few individuals to break the law."