Although you’ll find many who’ll argue against the rule (and there are some good arguments to be made), the sentence is correct. It has to do with the rule of compound possessives. With compound possessives, both nouns are possessive only when they possess separate things.