Thomas Aquinas gave a number of expressions to the principle of sola Scriptura. He made the following one while commenting on John 21:24-25 (which passage, btw, that Roman apologists use to try to disprove sola Scriptura). He wrote:
Now, we need to be careful not to attempt to construe Aquinas as a Protestant, or that he was always consistent in his expressions of sola Scriptura. But it is to say that his position at this juncture is far removed from that of modern day Roman apologists.Thomas Aquinas (1225/27-1274): It should be noted that though many might write concerning Catholic truth, there is this difference that those who wrote the canonical Scripture, the Evangelists and Apostles, and others of this kind, so constantly assert it that they leave no room for doubt. That is his meaning when he says "˜we know his testimony is true.´ Galatians 1:9, "œIf anyone preach a gospel to you other than that which you have received, let him be anathema!" The reason is that only canonical Scripture is a measure of faith. Others however so wrote of the truth that they should not be believed save insofar as they say true things.
Latin text: Notandum autem, quod cum multi scriberent de catholica veritate, haec est differentia, quia illi, qui scripserunt canonicam Scripturam, sicut Evangelistic et Apostoli, et alii huiusmodi, ita constanter eam asserunt quod nihil dubitandum relinquunt. Et ideo dicit Et scimus quia verum est testimonium eius; Gal. I, 9: Si quis vobis evangelizaverit praeter id quod accepistis, anathema sit. Cuius ratio est, quia sola canonica scriptura est regula fidei. Alii autem sic edisserunt de veritate, quod nolunt sibi credi nisi in his quae ver dicunt." See Thomas Aquinas, Super Evangelium S. Ioannis Lectura, ed. P. Raphaelis Cai, O.P., Editio V revisa (Romae: Marietti E ditori Ltd., 1952) n. 2656, p. 488.