The attack happened at around 8.50pm last night (Friday), in Landalewood Road, Rawcliffe.
The victim suffered a head injury following the assault and was taken to York Hospital for treatment.
Officers cordoned off the area last night to allow for forensic enquiries to take place.
Police are now urgently appealing for anyone who witnessed the incident, or has any information about it, to get in touch.
In particular, they would like to speak to anyone who saw mopeds being ridden in the area around the time of the assault.
Anyone with information is asked to contact police on 101, quoting incident number 486 of 3 February.