The first arcsecond localization of a short gamma-ray burst, GRB 050509B, has enabled detailed studies of a short burst environment. We here report on studies of the environment of GRB 050509B using the Swift X-ray Telescope (XRT). The XRT error circle of the burst overlaps with an elliptical galaxy in the cluster of galaxies ZwCl 1234.0+02916. Based on the measured X-ray flux of the cluster we estimate that the probability for a chance superposition of GRB 050509B and a cluster at least as X-ray bright as this cluster is $< 2times 10^{-3}$, presenting the first strong case of a short burst located in a cluster of galaxies. We also consider the case for GRB 050509B being located behind ZwCl 1234.0+02916 and gravitationally lensed. From the velocity dispersion of the elliptical galaxy and the temperature of hot intracluster gas, we model the mass distribution in the elliptical galaxy and the cluster, and calculate the gravitational lensing magnification within the XRT error circle. We find that, if GRB050509B would be positioned significantly behind the cluster, it is most likely magnified by a factor less than two, but that the burst could be strongly lensed if it is positioned within 2 arcsec of the center of the bright elliptical galaxy. Further mapping of arcsecond size short burst error boxes is a new promising route to determine the spatial distribution of old stars throughout the Universe.