In 2015, when Hungary was in the centre of the migratory flow, the decision on stopping the irregular migration was adopted by the Hungarian Government. The aim to stop the irregular migration and to protect the security of the Hungarian State and the citizens was acceptable for the Hungarian general public. In connection with the above-mentioned decision many modified regulations entered into force on 15 September 2015, among others the amendment of the Act on Criminal Procedure (Act XIX of 1998) and of the Hungarian Criminal Code (Act C of 2012) as well. Three new criminal offences were created by the legislator in relation to the irregular migration. These offences – the so-called crimes against the closing of border -were: irregular crossing the closing of border, damaging the closing of border and hindering the building on the closing of border.Taking account of the special character of these criminal offences, special procedural rules, a new Chapter titled „Special Criminal Proceedings”, were inserted into the Act on Criminal Procedure by the legislator. According to our research, there are many problems and anomalies in relation to this amendment, special reference to the principles of the criminal procedure, in particular the principle of legality. The aim of this short study is to present the problem with reference to this principle, in relation not only to the Act on Criminal Procedure in force, but also to the new Criminal Procedure Code (Act XC of 2017) as well, using the analytical method, and to create de lege ferenda proposal.