The disclosure relates to an injection attack detection method, device, server and storage medium, and relates to the field of computer technology. This embodiment provides a method for detecting injection attacks that does not depend on regular expressions, by generating a query statement to be executed based on user input data, and obtaining context information of the query statement, according to the context information and the input data, detecting whether the processing logic of the query statement changes, and if it is detected that the processing logic of the query statement changes, it is determined that the query statement has an injection vulnerability, and the execution of the query statement is terminated. Through this detection method, the false positive rate and false negative rate can be reduced, and the accuracy of attack detection can be improved.