8 Tweets Apr 13, 2023
API Injections. What is it?
Thread πŸ§΅πŸ‘‡
API injection occurs when the user sends malicious code with the API request as part of the request body or query parameter.
Most of the time, the code is a database query that executes and corrupts the database.
πŸ“Œ Command Injections
When an API injection brings a system command to the server, it turns into a Command injection.
The command, if executed, can delete site directories or the entire site from the server.
πŸ“Œ Example
A simple example is when you want to view the uploaded file. The API will take the file id to the server to retrieve it. If the user sends a malicious code along with the file id, it will be executed on the server.
πŸ“Œ API Injection impact
API injection can affect your API in the following ways:
- Database leak
- Authentication issues
- Full take-over of the system
- Denial of service (DoS)
- Attackers may carry out remote code execution
- Attackers may also create new functionality
πŸ“Œ Prevention techniques
- The user input should be sanitized properly both on the client and server sides.
- We can encode special characters and change their meaning. This way interpreter will treat them as data rather than special characters.
We have discussed API injections in detail on RapidAPI Guides. (rapidapi.com)
That’s all for now!
Follow @Rapid_API for more exclusive content. πŸ™

Loading suggestions...