SQL Injection
A prevalent web security vulnerability in which an attacker inserts malicious SQL statements into user input fields, causing the backend database engine to execute unintended queries. Successful exploitation can result in data breaches, authentication bypass, or unauthorized data modification.
Core Facts
Prompt注入(Prompt Injection)是针对大语言模型应用的安全威胁,攻击者通过在输入中嵌入恶意指令试图覆盖系统原有行为约束
Prompt Injection is a security attack method targeting AI applications, analogous to SQL injection in traditional web development.
The principle of SQL injection is that an attacker inserts malicious SQL statement fragments into user input fields; when the backend directly concatenates user input into database query statements, it is executed by the database engine, leading to data leakage, authentication bypass, or even database write operations.
Timeline (last 90 days)
The course selects five types of vulnerability scenarios for hands-on practice: SQL injection, XSS cross-site scripting, privilege escalation vulnerabilities, authentication and login vulnerabilities, and JS auditing.
The web vulnerability discovery stage focuses on the OWASP TOP 10, including SQL injection, privilege escalation vulnerabilities, and logic flaws.
The stateless nature of the HTTP protocol, request methods (GET/POST), status codes, header fields, and the Cookie mechanism are directly relevant to understanding Web vulnerabilities such as SQL injection, XSS, and CSRF.
A database dump/data breach refers to an attacker gaining read and write access to a database through SQL injection, weak passwords, exploitation of known vulnerabilities, or other means, and exporting user tables.
Unlike traditional SQL injection, prompt injection has no strict syntactic boundaries, making defense harder and often requiring a combination of layered measures such as input filtering, instruction isolation and output validation.
A WAF (Web Application Firewall) is a security device or software deployed in front of web servers that intercepts known attack patterns by inspecting the characteristics of HTTP requests.
Unlike SQL injection, prompt injection has no simple escaping or parameterization scheme, because there is no formal boundary between natural language instructions and data.
The UK National Cyber Security Centre (NCSC) points out that language models have no equivalent isolation mechanism, and prompt injection may never be completely fixed the way SQL injection has been.
Input validation is used to prevent attacks such as SQL injection and cross-site scripting (XSS), and the principle is to trust no data from the client side.
Building SQL queries with f-strings creates SQL injection risk; bound parameters or text(...).bindparams() should be used instead.
18 more timeline events
All Facts (20)
Prompt注入(Prompt Injection)是针对大语言模型应用的安全威胁,攻击者通过在输入中嵌入恶意指令试图覆盖系统原有行为约束
90%VerifiedPrompt Injection is a security attack method targeting AI applications, analogous to SQL injection in traditional web development.
85%VerifiedThe principle of SQL injection is that an attacker inserts malicious SQL statement fragments into user input fields; when the backend directly concatenates user input into database query statements, it is executed by the database engine, leading to data leakage, authentication bypass, or even database write operations.
80%VerifiedPrompt injection is essentially an architectural flaw in which large language models cannot distinguish data from instructions, analogous to traditional SQL injection in which the database engine confuses data with SQL instructions.
80%VerifiedSQL injection can fundamentally isolate data from instructions through parameterized queries, whereas there is currently no equivalent "parameterized" solution for the LLM inference process.
80%VerifiedVulnerabilities such as SQL injection, XSS, and SSRF have long occupied the OWASP Top 10 security risk list.
80%VerifiedUnlike SQL injection, prompt injection has no simple escaping or parameterization scheme, because there is no formal boundary between natural language instructions and data.
75%VerifiedPrompt injection is essentially an instruction hijacking attack that exploits the structural flaw of LLMs being unable to distinguish system instructions from user data at the semantic level, and is conceptually similar to SQL injection.
75%VerifiedA WAF (Web Application Firewall) is a security device or software deployed in front of web servers that intercepts known attack patterns by inspecting the characteristics of HTTP requests.
65%VerifiedPrompt injection shares a structural analogy with SQL injection vulnerabilities: the latter exploits a database's inability to distinguish SQL code from data strings, while the former exploits an LLM's inability to distinguish meta-instructions from the content being processed.
65%UnverifiedUnlike traditional SQL injection, prompt injection has no strict syntactic boundaries, making defense harder and often requiring a combination of layered measures such as input filtering, instruction isolation and output validation.
60%UnverifiedUnlike traditional SQL injection, prompt injection does not rely on syntax vulnerabilities but exploits the large language model's characteristic of treating everything it reads as a potential instruction.
60%UnverifiedPrompt injection attempts to override the system prompt and induce the model to perform unauthorized actions by embedding malicious instructions into external content processed by the model, and is logically analogous to SQL injection.
60%UnverifiedPrompt injection induces agents to perform unauthorized operations by embedding text disguised as instructions within content processed by the agent, operating on a principle similar to SQL injection.
60%UnverifiedLarge language models cannot reliably distinguish the boundary between system instructions and user/external content during inference—this is a fundamental limitation of prompt injection, similar in principle to SQL injection.
60%UnverifiedThe course selects five types of vulnerability scenarios for hands-on practice: SQL injection, XSS cross-site scripting, privilege escalation vulnerabilities, authentication and login vulnerabilities, and JS auditing.
50%UnverifiedThe web vulnerability discovery stage focuses on the OWASP TOP 10, including SQL injection, privilege escalation vulnerabilities, and logic flaws.
50%UnverifiedThe stateless nature of the HTTP protocol, request methods (GET/POST), status codes, header fields, and the Cookie mechanism are directly relevant to understanding Web vulnerabilities such as SQL injection, XSS, and CSRF.
50%UnverifiedA database dump/data breach refers to an attacker gaining read and write access to a database through SQL injection, weak passwords, exploitation of known vulnerabilities, or other means, and exporting user tables.
50%UnverifiedThe UK National Cyber Security Centre (NCSC) points out that language models have no equivalent isolation mechanism, and prompt injection may never be completely fixed the way SQL injection has been.
50%