Both earth and moon are subject to the gravitational force to the sun. As observed from the sun, the orbit of the moon
If the moon were to experience only the gravitation of the earth only then the path would have been elliptical but in the present case moon experience the gravitational force of sun as well which distorts the path.