A vulnerability is a weakness in an information system, security procedures, internal controls, or implementation that could be exploited or triggered by a threat source.
Types of Vulnerabilities -
Remote Code Execution (RCE) :
Remote Code Execution (RCE) is a critical security vulnerability that allows an attacker to run arbitrary code on a remote system, usually the server, without authorization. RCE occurs when an application or system: Takes user input, and Executes it as code, or passes it to a vulnerable component (e.g., shell, interpreter) without proper validation. This allows attackers to send specially crafted data that executes commands, installs malware, or takes control of the system. Consequences of RCE: Full server compromise, Data theft or loss, Lateral movement within a network, etc. RCE Examples: Log4Shell (Apache Log4j).
Injection :
An injection vulnerability is a security flaw that allows an attacker to inject malicious input into a program, causing it to interpret that input as code or commands instead of plain data. Applications often interact with databases, operating systems, web services, or interpreters using user-provided input. If the application fails to properly validate or escape this input, attackers can "inject" special code that the system mistakenly executes. Types of Injection:
- SQL Injection: Targets databases by injecting SQL commands.
- Command Injection: Targets the operating system, allowing execution of arbitrary system commands.
- XXE (XML External Entity): Targets XML parsers by injecting external entities to access files, perform SSRF, or cause DoS.
- XML Injection / XPath Injection: Targets XML parsers or XPath engines, manipulating XML data or queries.
- LDAP Injection: Targets LDAP directories, altering directory queries or bypassing authentication.
Insecure Deserialisation
Insecure deserialization is a vulnerability that occurs when an application deserializes untrusted or tampered data without proper validation, allowing an attacker to manipulate the serialized object in a way that leads to unintended behavior such as remote code execution (RCE), privilege escalation, authentication bypass, or denial of service (DoS). Serialization is the process of converting an object (such as a Python dictionary or a Java object) into a format that can be stored or transmitted, like JSON, XML, or binary. Deserialization is the reverse process, where the data is converted back into its original object form.
Server-Side Request Forgery (SSRF) :
Server-Side Request Forgery (SSRF) is a web vulnerability that occurs when an attacker is able to make the server send HTTP (or other protocol) requests to an unintended destination, typically due to insecure handling of user-supplied URLs or input. In SSRF, the attacker tricks the server into making a request to a target that the attacker cannot reach directly. This is possible when an application fetches data from a URL provided by the user — for example, downloading a file, accessing an image, or connecting to a webhook — without validating or restricting the destination. Prevent SSRF by restricting allowed domains/IPs, blocking internal metadata endpoints, using firewalls or network segmentation, validating user input, and limiting server response data exposure.
Broken Access Control (BAC) :
Broken Access Control is a security vulnerability that occurs when an application fails to properly enforce restrictions on what authenticated users are allowed to do, enabling attackers to gain unauthorized access to resources or perform actions outside their intended permissions. Access control defines who can perform specific actions within an application. When these rules are poorly implemented or entirely missing, it can allow malicious users to access other users' data, perform admin-level actions without proper authorization, or modify and delete records they should not have access to. Examples of Broken Access Control include Insecure Direct Object References (IDOR), where attackers modify user IDs in URLs to access unauthorized accounts; missing role checks that let regular users access admin functions; forced browsing to hidden, privileged endpoints; and relying on frontend restrictions without backend enforcement, allowing attackers to send unauthorized requests manually.
Broken Authentication :
Broken Authentication is a security vulnerability where an application’s authentication mechanisms are improperly implemented, allowing attackers to compromise user accounts, bypass authentication, or impersonate other users. Common causes include weak, predictable, or default passwords; poor session management (e.g., session IDs not rotated or invalidated on logout); credential stuffing attacks due to reused passwords; insecure password recovery or reset processes; exposing authentication tokens in URLs or logs; and failure to enforce multi-factor authentication (MFA) where appropriate. Consequences of broken authentication can include account takeover, data theft or unauthorized access, privilege escalation if administrative accounts are compromised, and fraud or identity theft.
Sensitive Data Exposure :
Sensitive Data Exposure is a security vulnerability that occurs when an application inadvertently exposes confidential or personal information to unauthorized parties. This can happen through weak encryption, improper handling, or insecure transmission and storage of sensitive data such as passwords, credit card numbers, personal identification details, or health records. When sensitive data is exposed, attackers can steal or manipulate it, leading to identity theft, financial loss, or privacy violations. Protecting sensitive data requires strong encryption, secure transmission protocols (like HTTPS), proper access controls, and careful data handling practices throughout the application lifecycle.
Security Misconfiguration :
Security Misconfiguration is a common vulnerability that occurs when security settings in an application, server, or platform are incorrectly configured or left at insecure defaults. This can expose the system to attacks by making it easier for attackers to exploit weaknesses, access sensitive data, or take control of the environment. Examples of security misconfiguration include leaving default passwords or keys unchanged, enabling unnecessary features, services, or ports, exposing sensitive information through debugging or error messages, and using insecure HTTP headers or outdated software versions.
Cross-Site Scripting (XSS) :
Cross-Site Scripting (XSS) is a web security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. These scripts are typically written in JavaScript and can be used to manipulate content, steal sensitive information such as cookies and session tokens, hijack user sessions, deface websites, redirect users to malicious sites, or perform actions on behalf of the user without their consent. XSS occurs when an application takes untrusted input—like form fields, URLs, or comments—and renders it in a web page without proper sanitization or escaping, allowing the attacker’s script to execute in the victim’s browser. To prevent XSS, output should be escaped based on its context (HTML, JavaScript, URL), input should be sanitized using libraries like DOMPurify, and a Content Security Policy (CSP) should be implemented to restrict script execution. Unsafe DOM methods like innerHTML should be avoided, and modern frameworks such as React or Angular, which automatically handle output encoding, should be used. Types of XSS:
- Stored XSS (Persistent): The malicious script is stored on the server (e.g., in comments or user profiles) and served to users later.
- Reflected XSS: The script is embedded in a URL or request and immediately reflected in the response, often in error messages or search results.
- DOM-based XSS: The vulnerability exists in client-side JavaScript that processes data from the browser without proper sanitization.
Cross-Site Request Forgery (CSRF) :
Cross-Site Request Forgery (CSRF) is a security vulnerability where an attacker tricks a logged-in user into unknowingly submitting unwanted actions on a web application. This happens because the user’s browser automatically includes their authentication credentials (like cookies) when making requests, so the server thinks the requests are legitimate. CSRF works by tricking a logged-in user’s browser into sending unauthorized requests to a trusted site without their knowledge, using their active authentication (like cookies). The site then processes these forged requests as if they were legitimate actions from the user. Prevent CSRF by using anti-CSRF tokens in forms and requests, requiring re-authentication for sensitive actions, setting the SameSite cookie attribute to restrict cross-site cookie sending, and verifying the request source through Referer or Origin headers.
SQL Injection :
SQL Injection (SQLi) is a type of cyberattack in which an attacker exploits vulnerabilities in an application by inserting malicious SQL (Structured Query Language) code into input fields. This can allow the attacker to manipulate the database—viewing, modifying, or deleting data they should not have access to. Most web applications interact with databases using SQL queries, and if user input is not properly validated or sanitized, attackers can craft input that alters the intended SQL query. SQL Injection enables attackers to bypass authentication, access and steal sensitive data, modify or delete records, execute administrative tasks, extract entire databases, and potentially take control of the server. To prevent SQL Injection, use prepared statements (parameterized queries) to ensure user input is treated as data, not code. Validate and sanitize all inputs through input validation and escaping. Follow the principle of least privilege by restricting database permissions. Utilize ORM frameworks, which often include built-in SQLi protection, and deploy web application firewalls (WAFs) as an additional defense layer. Types of SQLi:
-
In-Band SQLi: Attacker injects SQL and immediately sees results in the application’s response (e.g., input
' OR '1'='1
alters the query to always return true, bypassing authentication).
- Error-Based: Attacker causes database errors to gain information from error messages (e.g., injecting
' UNION SELECT NULL, version() --
reveals the database version through an error).
- Union-Based: Attacker uses the SQL UNION operator to combine results from the original query with malicious query results, retrieving data directly (e.g.,
' UNION SELECT username, password FROM users --
appends user data to the query output).
-
Blind SQLi: No direct output; attacker infers data by observing application behavior (e.g., using true/false queries to check if the first letter of username is ‘A’, with different page responses).
- Boolean-Based: Uses conditional queries causing different responses based on true/false evaluation (e.g.,
username = 'admin' AND 1=1
returns a normal page, while username = 'admin' AND 1=0 causes an error or different behavior).
- Time-Based: Uses delays to determine if conditions are true by measuring server response times (e.g., query causes a 5-second delay if the first password character is ‘a’).
- Out-of-Band SQLi: When direct or blind injection isn’t possible, attacker uses external channels like DNS or HTTP requests to receive data (e.g., database triggers a DNS lookup to attacker’s server, leaking data externally).