CAPEC-109
Object Relational Mapping Injection
An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject their own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
Soyutlama
Detailed
Tipik ciddiyet
High
Saldırı ihtimali
Low
Saldırıyı anla
Bu saldırı kalıbı nedir?
Uygulama akışı
Saldırı adım adım nasıl ilerler?
Explore
Determine Persistence Framework Used
Kullanılan teknikler
- 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.
Probe for ORM Injection vulnerabilities
Exploit
Perform SQL Injection through the generated data access layer
Kullanılan teknikler
- An attacker uses normal SQL injection techniques and adjusts them to reflect the type of data access layer generation framework used by the application.
Gereksinimler
Saldırının gerçekleşmesi için ne gerekir?
Ön koşullar
- 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
Gerekli beceri
- Medium: Knowledge of general SQL injection techniques and subtleties of the ORM framework is needed
Gerekli kaynak
- None: No specialized resources are required to execute this type of attack.
Etki
Başarılı saldırı neye yol açar?
Etkilenen alanlar: Integrity
Etkilenen alanlar: Availability
Etkilenen alanlar: Confidentiality
Etkilenen alanlar: Confidentiality, Access Control, Authorization
Etkilenen alanlar: Confidentiality, Integrity, Availability
Savunma
Nasıl önlenir ve etkisi azaltılır?
Gerçek dünya