The security issue of wireless communication is a common concern because of its broadcast nature, especially when the relay becomes an eavesdropper. In the orthogonal frequency division multiplexing (OFDM) relay system, when the relay is untrusted, the security of the system faces serious threats. Although there exist some resource allocation schemes in a single-carrier system with untrusted relaying, it is difficult to apply them to the multi-carrier system. Hence, a resource allocation scheme for the multi-carrier system is needed. Compared to the one-way relay system, a two-way relay system can improve the data transmission efficiency. In this paper, we consider joint secure resource allocation for a two-way cooperative OFDM system with an untrusted relay. The joint resource allocation problem of power allocation and subcarrier pairing is formulated to maximize the sum secrecy rate of the system under individual power constraints. To solve the non-convex problem efficiently, we propose an algorithm based on the alternative optimization method. The proposed algorithm is evaluated by simulation results and compared with the benchmarks in the literature. According to the numerical results, in a high signal-to-noise ratio (SNR) scenario, the proposed algorithm improves the achievable sum secrecy rate of the system by more than 15% over conventional algorithms.