As far as I’m aware, infallible teaching can come from three sources:
(1) Ecumenical Councils
(2) Ex Cathedra Papal decrees
(3) The Ordinary Magisterium
I am not aware of any papal decree touching just war doctrine that would satisfy the criteria for being ex cathedra.
As for ecumenical councils, their texts can all be found here:
historyandapologetics.com/p/ecumenical-councils.html
It appears to me that many of the ecumenical Councils have something to say about the Church’s just war doctrine. For example:
21st Ecumenical Council - “As long as the danger of war remains and there is no competent and sufficiently powerful authority at the international level, governments cannot be denied the right to legitimate defense once every means of peaceful settlement has been exhausted. State authorities and others who share public responsibility have the duty to conduct such grave matters soberly and to protect the welfare of the people entrusted to their care.”
source
18th Ecumenical Council - “Our aim is also to crush the Turks and other infidels standing firm in the eastern and southern regions. … Strengthened by defences not only spiritual but also temporal, we may be able, under God’s guidance and favour, to oppose the bitter and frequent sallies by which, in wild rage, they move savagely amidst christian blood.”
source
17th Ecumenical Council - “[T]he said ambassadors of the sacred council who are to travel on the galleys will arrange that ten thousand ducats are at hand to be expended, if necessary, on the defense of the city of Constantinople against any danger that the Turks might cause the city during the lord emperor’s absence… Also, the said ambassadors of the sacred council will pay the cost of two light galleys and three hundred crossbowmen for the defense of the city…”
source
15th Ecumenical Council - “These brothers and knights are to labour effectively and strive to win the holy Land and keep it, as far as God grants. … The young and the strong, who are able to fight, shall be required to go and stay overseas so that the holy Land may have its needs met. The order will thus pursue the purpose for which it was instituted, as is only right and fitting.”
source
14th Ecumenical Council - “[A]ll who glory in the name of Christian…should rise vigorously and openly in defence of the holy Land and support for God’s cause. …[T]he liberation of the holy Land should concern all who profess the catholic faith… [We] rightly commend [the] resolutions and praiseworthy enthusiasm for the liberation of that Land. … We therefore…do grant…unto all those who [go] to aid the holy Land…full pardon for their sins about which they are truly and heartily contrite and have spoken in confession…[and] this dutiful and holy general synod imparts…[its] blessings to all who piously set out on this enterprise…”
source
13th Ecumenical Council - “[In] the name of [God]…those who do not go in person to the aid of the holy Land should contribute…fighting men…”
source
12th Ecumenical Council - “[In] the name of [God]…those who do not go in person to the aid of the holy Land should contribute…fighting men…”
source
9th Ecumenical Council - “[We] command [Crusaders] by our apostolic authority…to complete the journey between this Easter and the following Easter. Otherwise, from that moment we cut them off from entry into church and forbid divine services in all their lands…”
source
6th Ecumenical Council - “[T]he living tradition of the Apostles of Christ…gives far-reaching victories to [the emperor] from the Lord of heaven…accompanies you in battle, and defeats your foes…[and] protects [the empire] on every side…[and] throws terror into opposing nations, and smites them with the divine wrath, which also in wars celestially gives triumphal palms over the downfall and subjection of the enemy, and ever guards your most faithful sovereignty secure and joyful in peace.”
source
As for the Ordinary Magisterium, it appears to me that it supports the Just War doctrine, as can be seen in many of the following documents from the Church Fathers:
historyandapologetics.com/p/catholic-military-history.html
I hope all that info is useful. God bless!