See the Vatican II document called LUMEN GENTIUM, which is classified as a "DOGMATIC CONSTITUTION ON THE CHURCH" which makes it infallible according to Catholic rules, "SOLEMNLY PROMULGATED BY HIS HOLINESS POPE PAUL VI", which makes it Ex Cathedra, "ON NOVEMBER 21, 1964." (The all caps is because I copied that text from the Vatican website which I linked to, and it was in all caps there.)
This document very plainly states:
Those also can attain to salvation who through no fault of their own do not know the Gospel of Christ or His Church, yet sincerely seek God and moved by grace strive by their deeds to do His will as it is known to them through the dictates of conscience.
The justification (such as it is) for this position is given the same paragraph, actually preceding what I quoted above:
Finally, those who have not yet received the Gospel are related in various ways to the people of God.(18*) In the first place we must recall the people to whom the testament and the promises were given and from whom Christ was born according to the flesh.(125) On account of their fathers this people remains most dear to God, for God does not repent of the gifts He makes nor of the calls He issues.(126)
That's the justification for the RCC's new position or notion that Jews can be saved outside the church. Now for the Muslims:
But the plan of salvation also includes those who acknowledge the Creator. In the first place amongst these there are the Muslims, who, professing to hold the faith of Abraham, along with us adore the one and merciful God, who on the last day will judge mankind. Nor is God far distant from those who in shadows and images seek the unknown God, for it is He who gives to all men life and breath and all things,(127) and as Saviour wills that all men be saved.(128)
Then immediately follows the first sentence I quoted.
So much for extra ecclesiam nulla salus; this document officially tosses that aside so far as Catholicism in communion with the Roman See is concerned. Anyone who disagrees with this but seems to continue in communion with Rome is functionally a Sedavanticist (one who believes the Vatican II popes are fake popes), whether they publicly claim to be such or not.
This also functionally obliterates the notion in the old Catholic traditions about infants who die unbaptized either going to hell or to limbo, since, if people outside the Catholic church can be saved by living according to their conscience, why should infants who die prematurely not also be? This is undoubtedly why the most up to date Catechism shies away from the old doctrine of limbo and merely expresses hope for the salvation of unbaptized infants. For example, see another document on the Vatican website, THE HOPE OF SALVATION FOR INFANTS WHO DIE WITHOUT BEING BAPTISED (this one doesn't have the same magesterial officialness as the other, as it is merely from an INTERNATIONAL THEOLOGICAL COMMISSION, but I quote it here only because of how it explains the Catechism's position on unbaptized infants):
This theory [the theory of limbo], elaborated by theologians beginning in the Middle Ages, never entered into the dogmatic definitions of the Magisterium, even if that same Magisterium did at times mention the theory in its ordinary teaching up until the Second Vatican Council. It remains therefore a possible theological hypothesis. However, in the Catechism of the Catholic Church (1992), the theory of limbo is not mentioned. Rather, the Catechism teaches that infants who die without baptism are entrusted by the Church to the mercy of God, as is shown in the specific funeral rite for such children.
Immediately after this, the reason for the change is described:
The principle that God desires the salvation of all people gives rise to the hope that there is a path to salvation for infants who die without baptism (cf. CCC, 1261), and therefore also to the theological desire to find a coherent and logical connection between the diverse affirmations of the Catholic faith: the universal salvific will of God; the unicity of the mediation of Christ; the necessity of baptism for salvation; the universal action of grace in relation to the sacraments; the link between original sin and the deprivation of the beatific vision; the creation of man “in Christ”.