I believe the church teaches that Mary was born without original sin by the Grace of God.
But she did not have to be. The Catecism states:
PART ONE
THE PROFESSION OF FAITH
SECTION TWO
THE PROFESSION OF THE CHRISTIAN FAITH
CHAPTER ONE
I BELIEVE IN GOD THE FATHER
III. ORIGINAL SIN
The consequences of Adam’s sin for humanity
402 All men are implicated in Adam’s sin, as St. Paul affirms: “By one man’s disobedience many (that is, all men) were made sinners”: "sin came into the world through one man and death through sin, and so death spread to all men because all men sinned."289 The Apostle contrasts the universality of sin and death with the universality of salvation in Christ. "Then as one man’s trespass led to condemnation for all men, so one man’s act of righteousness leads to acquittal and life for all men."290
403 Following St. Paul, the Church has always taught that the overwhelming misery which oppresses men and their inclination towards evil and death cannot be understood apart from their connection with Adam’s sin and the fact that he has transmitted to us a sin with which we are all born afflicted, a sin which is the “death of the soul”.291 Because of this certainty of faith, the Church baptizes for the remission of sins even tiny infants who have not committed personal sin.292
404 How did the sin of Adam become the sin of all his descendants? The whole human race is in Adam “as one body of one man”.293 By this “unity of the human race” all men are implicated in Adam’s sin, as all are implicated in Christ’s justice. Still, the transmission of original sin is a mystery that we cannot fully understand. But we do know by Revelation that Adam had received original holiness and justice not for himself alone, but for all human nature. By yielding to the tempter, Adam and Eve committed a personal sin, but this sin affected the human nature that they would then transmit in a fallen state.294 It is a sin which will be transmitted by propagation to all mankind, that is, by the transmission of a human nature deprived of original holiness and justice. And that is why original sin is called “sin” only in an analogical sense: it is a sin “contracted” and not “committed” - a state and not an act.
THis agrees with Romans 5:12 Wherefore, as by one man (singular) sin entered into the world, and death by sin; and so death passed upon all men (mankind), for that all have sinned:…
17 For if by one man’s offence death reigned by one; much more they which receive abundance of grace and of the gift of righteousness shall reign in life by one, Jesus Christ.