Sunday, November 24, 2024
HomeOWASP - Top 10A1 Injection OWSAP

A1 Injection OWSAP

Published on

A1 Injection vulnerability is currently ranked #1 on the OWASP Top 10 chart which means that it is responsible for a largeportion of public disclosures and security breaches.
So what is an injection vulnerability? Well, there are actually several types. Some of the most common types include SQLinjection, code injection and LDAP injection. With the different types of injection, the attacker will construct his attack in a different way.

SQL is an structured Query language that enables interaction with database servers. SQL commands such as INSERT, RETRIEVE, UPDATE, and DELETE are used to perform operations on the database.

SQL injection is a technique which attacker takes non-validated input vulnerabilities and inject SQL commands through webapplication that are executed in  backend database.

- Advertisement - SIEM as a Service
database-connection

SQL Injection:

Authentication Bypass:

Here an attacker could enter into network without providing any Authentication and gain highest privilege.

Information disclosure:

After attacker enters into the network, he will get access to sensitive date stored in the network.

Compromised data Integrity:

Attacker changes content of website by entering malicious contents.

Compromised Availability of data:

Using this technique attacker will delete sensitive and crucial information from database.

Remote Code Execution:

An attacker could modify, delete, or create data or even can create new accounts with full user rights on the servers that share files and folders. It allows an attacker to compromise the host operating system.

Significant risks

A1 Injection vulnerabilities also present some of the most significant risks when effectively exploited. Some of these risks include:

  • Data loss or corruption
  • Data theft.
  • Unauthorized access.
  • Denial of service.
  • Complete host system takeover.

SQL QUERY Vulnerable to attack:

select count (*) FROM Users  WHERE UserName=’ ” + txtUser.Text + ” ‘ AND passwords=’ ” + txtpassword.Text + ””’;

Similarly a blind text in framework make the framework vulnerable.

Query HQLQuery = session.createQuery(“FROM accounts WHERE custID=’“ + request.getParameter(“id”) + “‘”);

Understanding SQL Injection:

                          http://mydomain.com/test?Id=1                                       

                                     ↓

                        SELECT * FROM test WHERE ID = 1

Under normal circumstances it will probably translates down to  SELECT * FROM test WHERE ID = 1 , there might be a table named test and it simply saying select ID no.1 from the table. We need to look over here for different class of information.

                      Trusted data         http://mydomain.com/test?Id

                      Untrusted data       1

The first part we need to see here is what is trusted  data (http://mydomain.com/test?Id) and the un-trusted (1), the unstruted is the one which vulnerable to attack.

Now what happens if an attacker appending the condition http://mydomain.com/test?Id=1 or 1=1 if this condition passes through database then the login is going to change, instead of pulling a single ID it will pull the entire database.

COMMON DEFENSES:

  1. Whitelist untrusted data
  • What does we need trust?
  • Does it adhere to expected patterns?

2. Parameterise of SQL Statements

  • Separate the Query from the input data.
  • Type cast each operator.

3. Fine tune DB Permissions

  • Segment accounts of admin and public.
  • Apply “the principle of least privilege”.

Suggested Tools : Burp Suite, ZAP, Vega, SQLMAP, SQLSUS

Also Read:

Gurubaran
Gurubaran
Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Latest articles

Nearest Neighbor Attacks: Russian APT Hack The Target By Exploiting Nearby Wi-Fi Networks

Recent research has revealed that a Russian advanced persistent threat (APT) group, tracked as...

240+ Domains Used By PhaaS Platform ONNX Seized by Microsoft

Microsoft's Digital Crimes Unit (DCU) has disrupted a significant phishing-as-a-service (PhaaS) operation run by...

Russian TAG-110 Hacked 60+ Users With HTML Loaded & Python Backdoor

The Russian threat group TAG-110, linked to BlueDelta (APT28), is actively targeting organizations in...

Earth Kasha Upgraded Their Arsenal With New Tactics To Attack Organizations

Earth Kasha, a threat actor linked to APT10, has expanded its targeting scope to...

Free Webinar

Protect Websites & APIs from Malware Attack

Malware targeting customer-facing websites and API applications poses significant risks, including compliance violations, defacements, and even blacklisting.

Join us for an insightful webinar featuring Vivek Gopalan, VP of Products at Indusface, as he shares effective strategies for safeguarding websites and APIs against malware.

Discussion points

Scan DOM, internal links, and JavaScript libraries for hidden malware.
Detect website defacements in real time.
Protect your brand by monitoring for potential blacklisting.
Prevent malware from infiltrating your server and cloud infrastructure.

More like this

What is XSS (Cross-Site Scripting)? – A Detailed Understanding Of the Type of XSS

XSS is a very commonly exploited vulnerability type that is very widely spread and...

Cross-Site Request Forgery (CSRF) – An OWASP Vulnerability – Detailed Explanation

Cross Site Request Forgery is one of the most common form of attack by...

OWASP A10-Unvalidated Redirects and Forwards

Web applications often redirect and forward users to other pages and websites, and use...