Chapter 14 of the United Nations Charter

Article 92
The International Court of Justice shall be the principal judicial organ of the United Nations. It shall function in accordance with the annexed Statute, which is based upon the Statute of the Permanent Court of International Justice and forms an integral part of the present Charter.

Article 93

 * 1) All Members of the United Nations are ipso facto parties to the Statute of the International Court of Justice.
 * 2) A state which is not a Member of the United Nations may become a party to the Statute of the International Court of Justice on conditions to be determined in each case by the General Assembly upon the recommendation of the Security Council.

Article 94

 * 1) Each Member of the United Nations undertakes to comply with the decision of the International Court of Justice in any case to which it is a party.
 * 2) If any party to a case fails to perform the obligations incumbent upon it under a judgment rendered by the Court, the other party may have recourse to the Security Council, which may, if it deems necessary, make recommendations or decide upon measures to be taken to give effect to the judgment.

Article 95
Nothing in the present Charter shall prevent Members of the United Nations from entrusting the solution of their differences to other tribunals by virtue of agreements already in existence or which may be concluded in the future.

Article 96

 * 1) The General Assembly or the Security Council may request the International Court of Justice to give an advisory opinion on any legal question.
 * 2) Other organs of the United Nations and specialized agencies, which may at any time be so authorized by the General Assembly, may also request advisory opinions of the Court on legal questions arising within the scope of their activities.