We present two deterministic schemes for constructing a CNOT gate and a Toffoli gate on photonatom and photon-atom-atom hybrid quantum systems assisted by bad cavities, respectively. They are achieved by cavity-assisted photon scattering and work in the intermediate coupling region with bad cavities, which relaxes the difficulty of their implementation in experiment. Also, bad cavities are feasible for fast quantum operations and reading out information. Compared with previous works, our schemes do not need any auxiliary qubits and measurements. Moreover, the schematic setups for these gates are simple, especially that for our Toffoli gate as only a quarter wave packet is used to interact the photon with each of the atoms every time. These atom-cavity systems can be used as the quantum nodes in long-distance quantum communication as their relatively long coherence time is suitable for multi-time operations between the photon and the system. Our calculations show that the average fidelities and efficiencies of our two universal hybrid quantum gates are high with current experimental technology.A quantum computer 1 can run the famous Shor's algorithm 2 for integer factorization and implement Grover-Long algorithm 3,4 for unsorted database search. In past decades, it has attracted much attention. Quantum logic gates are the key elements in quantum computers and play a critical role in quantum information processing (QIP). Two-qubit controlled-not (CNOT) gates together with single-qubit gates are sufficient for universal quantum computing 1,5 . In 2004, Shende proposed a "small-circuit" structure which is used to construct CNOT gates 6 . In the domain of three-qubit gates, Toffoli gate has attracted much attention and it is universal. Together with Hadamard gates, it can realize unitary manipulation for a multi-qubit system 7,8 . Moreover, it plays an important role in phase estimation 1 , complex quantum algorithms 2-4 , error correction 9 , and fault tolerant quantum circuits 10 . In 2009, the optimal synthesis for a Toffoli gate with six CNOT gates was proposed 11 . Up to now, for a general three-qubit logic gate, the optimal synthesis requires twenty CNOT gates 12 , which means that this method increases the difficulty and complexity of experiments and the possibility of errors largely. It is significant to seek a simpler scheme to directly implement multi-qubit gates.By far, many physical systems have been used to implement quantum logic gates, such as photons in the polarization degree of freedom (DOF) [13][14][15] and those in both the polarization and the spatial-mode DOFs (the hyper-parallel photonic quantum computing) [16][17][18] , nuclear magnetic resonance [19][20][21][22] , quantum dots 23-27 , diamond nitrogen-vacancy center [28][29][30] , superconduting qubits 31,32 , superconducting resonators (microwave photons) 33,34 , and hybrid quantum systems 35,36 . Cavity quantum electrodynamics (QED) is a promising physical platform for constructing universal quantum logic gates as it can enhance the interac...