Title: Detection of injections in API requests using recurrent neural networks and transformers

Authors: A. Sujan Reddy; Bhawana Rudra

Addresses: Department of Information Technology, National Institute of Technology Karnataka, Srinivasnagar, Surathkal, Mangalore 575025, India ' Department of Information Technology, National Institute of Technology Karnataka, Srinivasnagar, Surathkal, Mangalore 575025, India

Abstract: Application programming interfaces (APIs) are playing a vital role in every online business. The objective of this study is to analyse the incoming requests to a target API and flag any malicious activity. This paper proposes a solution based on sequence models and transformers for the identification of whether an API request has SQL injections, code injections, XSS attacks, operating system (OS) command injections, and other types of malicious injections or not. In this paper, we observe that transformers outperform B-RNNs in detecting malicious activity which is present in API requests. We also propose a novel heuristic procedure that minimises the number of false positives. We observe that the RoBERTa transformer outperforms and gives an accuracy of 100% on our dataset. We observe that the heuristic procedure works well in reducing the number of false positives when a large number of false positives exist in the predictions of the models.

Keywords: vanilla recurrent neural networks; recurrent neural networks; RNNs; long short-term memory; gated recurrent units; GRU; security; application programming interfaces; API; bidirectional recurrent neural networks; BERT; structured query language; SQL.

DOI: 10.1504/IJESDF.2022.126451

International Journal of Electronic Security and Digital Forensics, 2022 Vol.14 No.6, pp.638 - 658

Received: 08 Jun 2021
Accepted: 13 Oct 2021

Published online: 26 Oct 2022 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article