We read at Mk 1:4-5 (NRSVCE):
John the baptizer appeared in the wilderness, proclaiming a baptism of repentance for the forgiveness of sins. And people from the whole Judean countryside and all the people of Jerusalem were going out to him, and were baptized by him in the river Jordan, confessing their sins.
We read on at Mtt 3:13-15:
Then Jesus came from Galilee to John at the Jordan, to be baptized by him. John would have prevented him, saying, “I need to be baptized by you, and do you come to me?” But Jesus answered him, “Let it be so now; for it is proper for us in this way to fulfill all righteousness.” Then he consented.
Although the term "baptism" is not used to describe the Jewish rituals, the purification rites in Jewish law and tradition, called tvilah, have some similarity to baptism, and the two have been linked. The tvilah is the act of immersion in natural sourced water, called a mikva. In the Jewish Bible and other Jewish texts, immersion in water for ritual purification was established for restoration to a condition of "ritual purity" in specific circumstances. For example, Jews who (according to the Law of Moses) became ritually defiled by contact with a corpse had to use the mikvah before being allowed to participate in the Holy Temple. Immersion was also required for converts to Judaism (Courtesy: Wikipedia)
Reverting to Jesus's statement to John that "it is proper for us in this way to fulfill all righteousness", one can conclude that John himself had received the Baptism of Repentance before he embarked on his mission of baptizing others. John`s humble submission that he ought to have been baptized by Jesus implies that Jesus did not baptize him . My question therefore is: According to Catholicism, by whom was John the Baptist was baptized?