Dark Mode
Capec-109 Detail
Object Relational Mapping Injection
Detailed Software Likelihood: Low Typical Severity: High
Parents: 66
Threats: T254 T255 T256 T259 T268 T290
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-109 | capec | https://capec.mitre.org/data/definitions/109.html | |
| CWE-20 | cwe | http://cwe.mitre.org/data/definitions/20.html | |
| CWE-89 | cwe | http://cwe.mitre.org/data/definitions/89.html | |
| CWE-564 | cwe | http://cwe.mitre.org/data/definitions/564.html | |
| REF-4 | reference_from_CAPEC | http://www.owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/07-Input_Validation_Testing/05.7-Testing_for_ORM_Injection | OWASP Web Security Testing Guide, The Open Web Application Security Project (OWASP) |
Explore
-
Determine Persistence Framework Used: An attacker tries to determine what persistence framework is used by the application in order to leverage a weakness in the generated data access layer code or a weakness in a way that the data access layer may have been used by the developer.
-
Probe for ORM Injection vulnerabilities: The attacker injects ORM syntax into user-controllable data inputs of the application to determine if it is possible modify data query structure and content.
| Techniques |
|---|
| An attacker provides input to the application in an attempt to induce an error screen that reveals a stack trace that gives an indication of the automated data access layer used. Or an attacker may simply make some educated guesses and assume, for instance, that Hibernate is used and try to craft an attack from there. |
Exploit
-
Perform SQL Injection through the generated data access layer: An attacker proceeds to exploit a weakness in the generated data access methods that does not properly separate control plane from the data plan, or potentially a particular way in which developer might have misused the generated code, to modify the structure of the executed SQL queries and/or inject entirely new SQL queries.
| Techniques |
|---|
| An attacker uses normal SQL injection techniques and adjusts them to reflect the type of data access layer generation framework used by the application. |
- An application uses data access layer generated by an ORM tool or framework
- An application uses user supplied data in queries executed against the database
- The separation between data plane and control plane is not ensured, through either developer error or an underlying weakness in the data access layer code generation framework
- None: No specialized resources are required to execute this type of attack.
| Medium |
|---|
| Knowledge of general SQL injection techniques and subtleties of the ORM framework is needed |
| Integrity | Availability | Authorization | Access Control | Confidentiality |
|---|---|---|---|---|
| Modify Data | Unreliable Execution | Gain Privileges | Gain Privileges | Read Data |
| Execute Unauthorized Commands (Run Arbitrary Code) | Execute Unauthorized Commands (Run Arbitrary Code) | Gain Privileges | ||
| Execute Unauthorized Commands (Run Arbitrary Code) |
- When using Hibernate, it is possible to use the session.find() method to run queries against the database. This is an overloaded method that provides facilities to perform binding between the supplied user data and place holders in the statically defined query. However, it is also possible to use the session.find() method without using any of these query binding overloads, hence effectively concatenating the user supplied data with rest of the SQL query, resulting in a possibility for SQL injection. While the framework may provide mechanisms to use methods immune to SQL injections, it may also contain ways that are not immune that may be chosen by the developer.