appsec.fyi

SQL Injection Resources

Post Share

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

SQL Injection

SQL injection (SQLi) is the insertion of malicious SQL queries via input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify or delete records, execute administrative operations, and in some cases issue commands to the operating system.

Despite being one of the oldest web vulnerability classes, SQL injection continues to appear in modern applications — particularly in legacy codebases, custom query builders, and applications that construct SQL through string concatenation rather than parameterized queries. Second-order SQLi, where the payload is stored first and executed later in a different context, is especially difficult to detect with automated scanners.

SQLi techniques have evolved well beyond simple UNION SELECT attacks. Blind SQLi uses boolean conditions or time delays to extract data one bit at a time. Error-based injection leverages database error messages to leak information. Out-of-band SQLi exfiltrates data through DNS or HTTP requests initiated by the database. Each database engine — MySQL, PostgreSQL, MSSQL, Oracle, SQLite — has its own syntax quirks and exploitation techniques.

Modern WAFs and prepared statements have reduced the attack surface, but bypasses are regularly discovered through encoding tricks, comment injection, and parser differentials between the WAF and the database.

This page collects SQLi techniques, cheat sheets, bypass methods, and real-world exploitation writeups across all major database platforms.

From OWASP

Date Added Link Excerpt
2026-04-29 NEW 2026CVE-2026-42208: LiteLLM bug exploited 36 hours after its disclosure news AIWriteup of CVE-2026-42208 in LiteLLM, an SQL injection vulnerability in the proxy API key verification. Attackers exploited this flaw rapidly, within 36 hours of its disclosure, targeting sensitive data like virtual API keys and provider credentials by crafting malicious Authorization headers. The vulnerability affected LiteLLM versions 1.81.16 to 1.83.6 and was patched in 1.83.7. → securityaffairs.com
2026-04-29 NEW 2026LiteLLM exploited within 36 hours of disclosure via SQL injection bug news AILibrary vulnerability: CVE-2026-42208 in LiteLLM, an LLM proxy, allowed attackers to read and modify database data, accessing provider credentials like those from OpenAI and Anthropic, and exposing sensitive IP and employee data. Exploitation occurred within 36 hours of disclosure, highlighting the accelerating trend of rapid weaponization enabled by AI, outpacing previous vulnerability disclosure timelines. → scworld.com
2026-04-29 NEW 2026Fresh LiteLLM Vulnerability Exploited Shortly After Disclosure news AILibrary for securing AI gateways; a critical-severity SQL injection vulnerability (CVE-2026-42208, CVSS 9.3) in LiteLLM allowed unauthenticated attackers to exfiltrate database credentials and API keys by exploiting the proxy API key verification process. Attacks were observed shortly after disclosure, targeting database tables containing sensitive information. LiteLLM version 1.83.7 resolves this by properly parameterizing database queries. → securityweek.com
2026-04-29 NEW 202638 Vulnerabilities Found in OpenEMR Medical Software news MobileAnalysis of OpenEMR reveals 38 CVE-assigned vulnerabilities, including critical SQL injection flaws (CVE-2026-24908, CVE-2026-23627) allowing database compromise and PHI exfiltration, and an authorization bypass (CVE-2026-24487) exposing patient data. These issues, primarily stemming from authorization flaws, were identified by Aisle and have since been patched by OpenEMR developers. → securityweek.com
2026-04-29 NEW 2026LiteLLM CVE-2026-42208 SQL Injection Exploited within 36 Hours of Disclosure newsWriteup of CVE-2026-42208, a critical SQL injection vulnerability in BerriAI's LiteLLM Python package, actively exploited within 36 hours of disclosure. The flaw, affecting versions between 1.81.16 and 1.83.7, allowed unauthenticated attackers to modify the LiteLLM proxy database, potentially accessing and altering credentials for LLM providers like OpenAI, Anthropic, and AWS. Exploitation attempts targeted tables such as `litellm_credentials.credential_values`, suggesting attackers sought to compromise cloud-grade credentials managed by the AI gateway. → thehackernews.com
2026-04-28 NEW 2026Hackers are exploiting a critical LiteLLM pre-auth SQLi flaw newsLibrary for securing LiteLLM, an open-source LLM gateway, against the CVE-2026-42208 pre-authentication SQL injection vulnerability. Attackers exploit this flaw in the API key verification step to access and modify sensitive data, including API keys, credentials, and environment secrets. The vulnerability allows unauthorized access to the proxy and managed credentials, with active exploitation observed targeting specific tables containing secrets from providers like OpenAI and Anthropic. A fix is available in LiteLLM version 1.83.7. → bleepingcomputer.com
2026-04-28 NEW 2026Critical LiteLLM SQL Injection Vulnerability Exploited in the Wild newsA critical SQL injection vulnerability in LiteLLM has been exploited in the wild. This flaw allows attackers to inject malicious SQL code, potentially leading to unauthorized data access or modification. Details are limited, but the discovery highlights a significant security risk for users of LiteLLM. Further information on the specific exploit and mitigation strategies is expected. → cybersecuritynews.com
2026-04-28 NEW 2026Critical LiteLLM SQL Injection Vulnerability Exploited in the Wild newsA critical SQL injection vulnerability has been discovered in LiteLLM, an open-source LLM application. This vulnerability has reportedly been exploited in the wild, meaning attackers have already taken advantage of it. The exact nature of the exploitation and its impact are not detailed in the provided text, beyond the classification of "critical." Further information regarding the vulnerability and potential mitigation steps is available through the provided link. → cyberpress.org
2026-04-28 NEW 2026Critical LiteLLM Flaw Enables Database Attacks Through SQL Injection newsA critical vulnerability has been discovered in LiteLLM, an open-source library facilitating access to various LLM APIs. This flaw allows for SQL injection attacks, potentially enabling unauthorized access and manipulation of backend databases. Researchers have disclosed this vulnerability, highlighting the significant security risk it poses to applications using LiteLLM. Details of the vulnerability and its implications were published, emphasizing the need for prompt patching and security updates. No specific payout amount was mentioned in the provided content. → gbhackers.com
2026-04-28 NEW 2026LiteLLM Contains Critical SQL Injection Vulnerability news API SecLiteLLM, a popular open-source library for interacting with large language models, has a critical SQL injection vulnerability. This flaw could allow attackers to execute arbitrary SQL commands, potentially leading to data theft or unauthorized modifications. The vulnerability is found in the library's handling of user inputs. Further details can be found at the provided link. → letsdatascience.com
2026-04-23 2026LangChain framework hit by several worrying security issues here's what we know newsLangChain framework hit by several worrying security issues — here's what we know https://ift.tt/XaO0IvB → msn.com
2026-04-22 2026CVE-2025-1094: PostgreSQL SQL Injection Vulnerability newsWriteup of CVE-2025-1094, a critical SQL injection vulnerability in PostgreSQL affecting PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() functions, as well as the psql terminal. Exploitation is possible through improper neutralization of quoting syntax and invalid multibyte characters, potentially leading to arbitrary code execution. Versions prior to 17.3, 16.7, 15.11, 14.16, and 13.19 are affected.
2026-04-22 2026SQLMap Tamper Collection: Modern WAF Bypass Scripts (Cloudflare, AWS, Azure) intermediateLibrary for context-aware SQL transformation and WAF bypass, supporting Cloudflare, AWS, and Azure. It features a full SQL lexer with UUID tracking, multi-character operator support, and deterministic output preserving SQL validity. Transformations include keyword wrapping, space replacement, value encoding, and case alternation, with advanced options like homoglyphs and numeric obfuscation. The framework maintains SQL structure, handles nested subqueries, and offers reapplication protection, designed primarily for MySQL syntax.
2026-04-22 2026SQL Injection and Postgres: An Adventure to Eventual RCE intermediateLibrary for leveraging PostgreSQL functions to achieve Remote Code Execution (RCE) via SQL Injection. This resource details exploiting an ORDER BY clause injection in a Flask application, demonstrating techniques for data exfiltration using error messages and the `query_to_xml` function to bypass row limitations and achieve command execution as the database user.
2026-04-22 2026Pentesting PostgreSQL with SQL Injections intermediateLibrary for analyzing and exploiting SQL injection vulnerabilities specifically targeting PostgreSQL. It details bypass methods for web application firewalls, techniques for data exfiltration across various query clauses including SELECT, WHERE, FROM, and ORDER BY, and demonstrates how to exploit nested queries. The resource covers bypassing spaces, trailing data, quotation marks using dollar quoting or `CHR()` function, and utilizes time-based blind SQL injection with concatenation and conditional logic for data leakage. → onsecurity.io
2026-04-22 2026NoSQL Injection: Advanced Exploitation Guide advancedGuide to exploiting NoSQL injection vulnerabilities, detailing how improper input sanitization allows attackers to bypass authentication on MongoDB and other databases. It covers identifying injections by manipulating syntax and using operators like `$gt` and `$ne`, and demonstrates advanced techniques such as extracting data through time delays using the `$where` operator. → intigriti.com
2026-04-22 2026Exploits Explained: NoSQL Injection Returns Private Information beginnerWriteup detailing a NoSQL injection vulnerability discovered in an application's `/api/[CLIENT_NAME]/Customers` and `/api/[CLIENT_NAME]/CustomerLogins` endpoints. The author leveraged MongoDB query operators, specifically `gt`, to bypass filters and extract sensitive PII, including email addresses, usernames, password hashes, and phone numbers, from the administrator user. The exploit involved manipulating the `$filter` parameter to retrieve data beyond the intended scope.
2026-04-22 2026CVE-2025-52694 PoC: Critical SQL Injection in Advantech IoTSuite/SaaS-Composer newsToolchain for CVE-2025-52694, a critical unauthenticated SQL Injection vulnerability impacting Advantech IoTSuite/SaaS-Composer products prior to specific versions. The PoC offers a standalone Python script for time-based SQL injection tests and a nuclei template utilizing a clusterbomb attack to discover vulnerable `org_id` values. Exploitation allows for database dumping, data modification, and potential RCE by unsafely concatenating the `filename` parameter into PostgreSQL queries.
2026-04-22 2026MCP Vulnerability Case Study: SQL Injection in the Postgres MCP Server intermediateWriteup on a SQL injection vulnerability in Anthropic's reference Postgres MCP server, allowing arbitrary SQL execution by terminating the read-only transaction with a `COMMIT;` statement. Though deprecated, the `@modelcontextprotocol/server-postgres` NPM package and `mcp/postgres` Docker image see significant weekly downloads. The vulnerability is patched in the Zed Industries fork (`@zeddotdev/postgres-context-server` v0.1.4) and an unreleased reference implementation. Users should avoid the deprecated server for sensitive data and consider the Zed Industries fork for mitigation. → securitylabs.datadoghq.com
2026-04-22 2026BWAFSQLi: Bypassing Web Application Firewall with Adversarial SQL Injections advancedBWAFSQLi: Bypassing Web Application Firewall with Adversarial SQL Injections → dl.acm.org
2026-04-19 2026Unauthenticated SQL Injection in GUI — Fortinet PSIRT intermediateAnalysis of unauthenticated SQL injection in FortiWeb's GUI, allowing code execution via crafted HTTP/HTTPS requests. This vulnerability (CWE-89) has been observed exploited in the wild, with a workaround involving disabling the administrative interface. The report originates from Fortinet PSIRT, with credit to Kentaro Kawane.
2026-04-19 2026CVE-2025-1094 WebSocket and SQL Injection Exploit Script newsExploit script for CVE-2025-1094, a PostgreSQL vulnerability enabling SQL Injection to achieve Remote Code Execution. This proof of concept demonstrates hijacking WebSocket connections after injecting malicious SQL using `lo_export` to read sensitive files, ultimately establishing a reverse shell. The script requires configuration of attacker IP/port, target URL, and WebSocket URL.
2026-04-19 2026CVE-2025-1094: PostgreSQL psql SQL Injection (Fixed) — Rapid7 newsAnalysis of CVE-2025-1094, a high-severity SQL injection vulnerability in PostgreSQL's psql tool, impacting versions prior to 17.3, 16.7, 15.11, 14.16, and 13.19. Discovered by Rapid7, this flaw, with a CVSS 3.1 score of 8.1, arises from improper handling of escaped untrusted input containing invalid UTF-8 characters. Exploitation can lead to arbitrary code execution via meta-commands or arbitrary SQL statement execution. This vulnerability was found to be a prerequisite for exploiting CVE-2024-12356 against BeyondTrust products, though both are now patched. → rapid7.com
2026-04-19 2026PostgreSQL CVE-2025-1094: Quoting APIs SQL Injection intermediateLibrary detailing SQL injection vulnerabilities in PostgreSQL's quoting APIs, specifically PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(). The vulnerability, identified as CVE-2025-1094, allows attackers to inject SQL when application inputs are constructed into psql commands. It also affects command-line utilities under specific client and server encoding conditions (BIG5, EUC_TW, MULE_INTERNAL). Versions prior to PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected.
2026-04-19 2026CVE-2025-26794: Blind SQL Injection in Exim 4.98 — Writeup intermediateWriteup detailing CVE-2025-26794, a blind SQL injection vulnerability in Exim 4.98 when SQLite is used as the DBM. The vulnerability arises from unsanitized SQL parameters within the ETRN command's semaphore handling in `hintsdb.h`, allowing remote users to craft malicious SQLite queries. This writeup covers the exploitation vector via the ETRN command to manipulate Exim's internal SQLite database, potential impacts including DoS and hypothetical RCE, and provides a Docker lab for reproduction.
2026-04-17 2026April 2026 Patch Tuesday: Critical Vulnerabilities in SAP Adobe Microsoft SharePoint Fortinet and ColdFusion Threaten Enterprise Security newsAdvisory detailing critical vulnerabilities patched in April 2026 across SAP Business Planning and Consolidation (CVE-2026-27681, SQL injection), Adobe Acrobat Reader (CVE-2026-34621, RCE, actively exploited), Adobe ColdFusion (CVE-2026-34619, CVE-2026-27304, CVE-2026-27305, CVE-2026-27282, CVE-2026-27306, path traversal, ACE), Fortinet FortiSandbox (CVE-2026-39813, CVE-2026-39808, path traversal, command injection), and Microsoft SharePoint Server (CVE-2026-32201, spoofing, data exposure, actively exploited), posing risks of data exfiltration and system compromise. → rescana.com
2026-04-16 2026SQLMap Cheat Sheet: Commands, Options, and Advanced Features intermediateCheatsheet detailing sqlmap commands, options, and advanced features for automating SQL injection detection and exploitation. It covers system requirements, installation, various SQLi attack techniques including in-band (error-based, union-based, stacked queries, inline queries), out-of-band, inferential (boolean, time-based), and compound attacks, alongside essential options for reconnaissance, enumeration, and vulnerability scanning.
2026-04-16 2026Identifying SQL Injections in a GraphQL API intermediateWriteup detailing a time-based SQL injection vulnerability discovered in a GraphQL API backed by a PostgreSQL database. The technique involves intercepting requests via Burp Suite, altering client-generated search terms with SQL payloads, and analyzing response times to confirm command execution and enumerate database schema. The writeup also touches on potential for privilege escalation and RCE via CVE-2019–9193, and reiterates parameterized queries as a key mitigation.
2026-04-16 2026SQL Injection Cheat Sheet - Invicti beginnerLibrary of SQL injection payloads and techniques for MySQL, Microsoft SQL Server, Oracle, PostgreSQL, and SQLite, offering detailed technical information and attack vectors. This resource is useful for penetration testers and developers interested in web application security, covering exploitation methods like UNION attacks, blind SQL injection with IF statements and CASE expressions, hex value usage, string concatenation, and error-based injection, also noting the role of DAST tools like Invicti for automated detection. → invicti.com
2026-04-16 2026Exploiting Time-Based SQL Injections: Data Exfiltration intermediateExploiting Time-Based SQL Injections: Data Exfiltration
2026-04-16 2026Second-Order SQL Injection with Stored Procedures and DNS-Based Egress advancedWriteup detailing the detection and exploitation of a second-order SQL injection vulnerability, leveraging Out-of-Band (OOB) techniques via DNS exfiltration. The technique involves exploiting a Microsoft Excel report export feature where a crafted payload in the date parameter, when processed by the `xp_dirtree` stored procedure, triggers DNS requests to an attacker-controlled server. This allows for the disclosure of sensitive database information, including usernames and tables, by chaining SQL Server UNC Path Injection with DNS-based data exfiltration.
2026-04-16 2026When the Database Won't Talk: A Deep Dive into Blind SQLi intermediateReference detailing Blind SQL Injection techniques, including Boolean-based, Time-based with SQL variants like `SLEEP()` and `pg_sleep()`, and Out-of-Band (OOB) methods involving DNS or HTTP callbacks. It highlights attacker exploitation methods and defense strategies such as parameterized queries, input sanitization, and monitoring for inconsistent behavior, response time variations, or external service interactions. The entry also mentions the Hadrian platform for detecting these vulnerabilities.
2026-04-16 2026Advanced Boolean-Based SQLi Filter Bypass Techniques advancedTechnique for bypassing libinjection filters in Web Application Firewalls using advanced boolean-based SQL injection. This method leverages MySQL string functions like `INSERT`, `REPEAT`, `REPLACE`, `RIGHT`, `WEIGHT_STRING`, conditional constructs such as `IF` statements, and the `RLIKE` operator for bruteforcing hashed passwords. It also incorporates comments and assignment operators (`:=`) within SQL syntax to evade detection by security tools.
2026-04-16 2026WAF Bypass Techniques for SQL Injection intermediateWAF Bypass Techniques for SQL Injection
2026-04-16 2026Exploiting Second-Order SQL Injection to Retrieve the Flag intermediateExploiting Second-Order SQL Injection to Retrieve the Flag
2026-04-16 2026Exploiting SQL Injection Vulnerability - Bug Bounty Writeup intermediateExploiting SQL Injection Vulnerability - Bug Bounty Writeup
2026-04-16 2026LangChain framework hit by several worrying security issues here's what we know newsLangChain framework hit by several worrying security issues — here's what we know https://ift.tt/ENiUzLF → msn.com
2026-04-15 2026SAP Security Patch Day April 2026: Critical Vulnerabilities CVSS 9.9 SQL Injection and Authorization Risks newsAnalysis of SAP Security Patch Day April 2026 highlights critical vulnerabilities, including a CVSS 9.9 SQL injection in SAP Business Planning and Consolidation and SAP Business Warehouse, allowing authenticated users to execute arbitrary SQL. A high-severity authorization flaw in SAP ERP and SAP S/4HANA, with a CVSS of 7.1, permits authenticated users to overwrite existing executable reports. Medium-priority issues affect SAP BusinessObjects BI Platform with denial-of-service and SAP Human Capital Management for SAP S/4HANA with information disclosure. Practitioners like SecurityBridge, Pathlock, and Layer Seven Security detail exploitation paths, internal authorization risks, and cross-layer exposure across SAP environments.
2026-04-15 2026FortiClient Hit by Severe SQL Injection Vulnerability Enabling Database Intrusion newsFortiClient Hit by Severe SQL Injection Vulnerability Enabling Database Intrusion https://ift.tt/ENselVr → gbhackers.com
2026-04-14 2026CISA Warns of Fortinet SQL Injection Vulnerability Actively Exploited in Attacks newsCISA Warns of Fortinet SQL Injection Vulnerability Actively Exploited in Attacks https://ift.tt/HrQnkXP → cybersecuritynews.com
2026-04-14 2026SAP Patch Day Fixes Critical SQL Injection DoS and Code Injection Flaws newsSAP Patch Day Fixes Critical SQL Injection, DoS, and Code Injection Flaws https://ift.tt/wOQTGjW → gbhackers.com
2026-04-14 2026SAP Patch Day Fixes Critical SQL Injection DoS and Code Injection Flaws newsSAP Patch Day Fixes Critical SQL Injection, DoS, and Code Injection Flaws https://ift.tt/lgQwt4L → cyberpress.org
2026-04-14 2026CISA Warns of Fortinet SQL Injection Flaw Actively Exploited in Attacks newsCISA Warns of Fortinet SQL Injection Flaw Actively Exploited in Attacks https://ift.tt/kN2acMA → cyberpress.org
2026-04-14 2026CISA Warns Fortinet SQL Injection Flaw Is Being Actively Exploited newsCISA Warns Fortinet SQL Injection Flaw Is Being Actively Exploited https://ift.tt/3sSd5jK → gbhackers.com
2026-04-14 2026SAP Patch Day Fixes Critical SQL Injection DoS and Code Injection Flaws newsSAP Patch Day Fixes Critical SQL Injection, DoS, and Code Injection Flaws https://ift.tt/QS2AJx7 → cyberpress.org
2026-04-11 2026400K WordPress Sites Exposed by Elementor Ally Plugin SQL Flaw newsLibrary vulnerability in Elementor's Ally plugin, tracked as CVE-2026-2413, exposes over 400,000 WordPress sites to SQL injection attacks. Exploitable without authentication when the Remediation module is active, the flaw allows attackers to steal sensitive data like password hashes by manipulating database queries through crafted URL parameters. Elementor has released a patch, and users are advised to update the plugin, disable unused features, deploy a WAF, and enforce least privilege for database accounts. → esecurityplanet.com
2026-04-10 2026SQL Injection in 2026: It Took One Apostrophe intermediateSQL Injection in 2026: It Took One Apostrophe
2026-04-10 2026Advanced SQL Injection Techniques in Modern Web Apps advancedWriteup detailing advanced SQL injection techniques like second-order, time-based blind, and WAF bypasses through encoding and case variation. It emphasizes prevention strategies such as parameterized queries, strict input validation, and least privilege for database users, and mentions tools like SQLi Detector for automated testing, highlighting real-world applications in e-commerce platforms, CMS systems, and API endpoints.
2026-04-10 2026Bypassing WAF with Adversarial SQL intermediateBypassing WAF with Adversarial SQL → dl.acm.org
2026-04-10 2026WAF Bypass Using JSON-Based SQL Injection Attacks intermediateLibrary entry detailing a WAF bypass technique using JSON-based SQL injection, building on research that found major vendors like Palo Alto Network, AWS, Cloudflare, F5, and Imperva failed to properly inspect JSON payloads. This method exploits the compatibility of databases such as PostgreSQL and MySQL with JSON, allowing malicious SQL commands to evade detection by many Web Application Firewalls. → picussecurity.com

Frequently Asked Questions

What is SQL injection?
SQL injection is a code injection technique where an attacker inserts malicious SQL statements into input fields or parameters that are incorporated into database queries. Successful exploitation can read, modify, or delete database data, and in some cases execute operating system commands.
What is the difference between blind and error-based SQLi?
Error-based SQLi extracts data through database error messages visible in the application response. Blind SQLi works when errors are suppressed — it infers data using boolean conditions (true/false responses) or time delays (e.g., IF condition THEN SLEEP(5)). Blind SQLi is slower but works in more restrictive environments.
Are prepared statements enough to prevent SQLi?
Prepared statements (parameterized queries) prevent classic SQLi in most cases. However, they cannot parameterize table names, column names, or ORDER BY clauses. Dynamic SQL built from these elements still requires allowlist validation. ORMs reduce risk but can be bypassed through raw query methods.

Weekly AppSec Digest

Get new resources delivered every Monday.