Measurements of the gas mass are necessary to determine the planet formation potential of protoplanetary disks. Observations of rare CO isotopologues are typically used to determine disk gas masses; however, if the line emission is optically thick this will result in an underestimated disk mass. With ALMA we have detected the rarest stable CO isotopologue, 13C17O, in a protoplanetary disk for the first time. We compare our observations with the existing detections of 12CO, 13CO, C18O and C17O in the HD163296 disk. Radiative transfer modelling using a previously benchmarked model, and assuming interstellar isotopic abundances, significantly underestimates the integrated intensity of the 13C17O J=3-2 line. Reconciliation between the observations and the model requires a global increase in CO gas mass by a factor of 3.5. This is a factor of 2-6 larger than previous gas mass estimates using C18O. We find that C18O emission is optically thick within the CO snow line, while the 13C17O emission is optically thin and is thus a robust tracer of the bulk disk CO gas mass.