CWE•Base•Stable•20 recent CVEs
CWE-89Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Description
The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Common consequences
- Confidentiality,Integrity,Availability→Execute Unauthorized Code or CommandsAdversaries could execute system commands, typically by changing the SQL statement to redirect output to a file that can then be executed.
- Confidentiality→Read Application DataSince SQL databases generally hold sensitive data, loss of confidentiality is a frequent problem with SQL injection vulnerabilities.
- Authentication→Gain Privileges or Assume Identity,Bypass Protection MechanismIf poor SQL commands are used to check user names and passwords or perform other kinds of authentication, it may be possible to connect to the product as another user with no previous knowledge of the password.
- Access Control→Bypass Protection MechanismIf authorization information is held in a SQL database, it may be possible to change this information through the successful exploitation of a SQL injection vulnerability.
- Integrity→Modify Application DataJust as it may be possible to read sensitive information, it is also possible to modify or even delete this information with a SQL injection attack.
Potential mitigations
- Architecture and Design[object Object]
- Architecture and Design[object Object]
- Architecture and Design,Operation[object Object]
- Architecture and DesignFor any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
- Implementation[object Object]
- Implementation[object Object]
- Architecture and DesignWhen the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- Implementation[object Object]
- OperationUse an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481.
- Operation,ImplementationWhen using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
Related CWEs
Recent CVEs classified under this CWE
CVE-2026-447446.52026-06-09CVE-2026-115856.32026-06-08CVE-2026-115846.32026-06-08CVE-2026-115836.32026-06-08CVE-2026-115827.32026-06-08CVE-2026-115596.32026-06-08CVE-2026-115586.32026-06-08CVE-2026-115317.32026-06-08CVE-2026-115307.32026-06-08CVE-2026-115296.32026-06-08CVE-2026-115146.32026-06-08CVE-2026-115136.32026-06-08CVE-2026-115106.32026-06-08CVE-2026-115096.32026-06-08CVE-2026-115086.32026-06-08CVE-2026-115076.32026-06-08CVE-2026-115066.32026-06-08CVE-2026-115017.32026-06-08CVE-2026-114956.32026-06-08CVE-2026-114907.32026-06-08