CVE-2025-60542 is a medium-severity (CVSS 6.5) SQL Injection vulnerability in typeorm. A fix is available for typeorm — see the affected versions and patch details below.
TypeORM vulnerable to SQL injection via crafted request to repository.save or repository.update
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-60542.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2025-60542 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,636 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
typeormnpmDescription
Summary
SQL Injection vulnerability in TypeORM before 0.3.26 via crafted request to repository.save or repository.update due to the sqlstring call using stringifyObjects default to false.
Details
Vulnerable Code:
const { username, city, name} = req.body;
const updateData = {
username,
city,
name,
id:userId
}; // Developer aims to only allow above three fields to be updated
const result = await userRepo.save(updateData);
Intended Payload (non-malicious):
username=myusername&city=Riga&name=Javad
OR
{username:\"myusername\",phone:12345,name:\"Javad\"}
SQL query produced:
UPDATE `user`
SET `username` = 'myusername',
`city` = 'Riga',
`name` = 'Javad'
WHERE `id` IN (1);
Malicious Payload:
username=myusername&city[name]=Riga&city[role]=admin
OR
{username:\"myusername\",city:{name:\"Javad\",role:\"admin\"}}
SQL query produced with Injected Column:
UPDATE `user`
SET `username` = 'myusername',
`city` = `name` = 'Javad',
`role` = 'admin'
WHERE `id` IN (1);
Above query is valid as city = name = Javad is a boolean expression resulting in city = 1 (false). “role” column is injected and updated.
Underlying issue was due to TypeORM using mysql2 without specifying a value for the stringifyObjects option. In both mysql and mysql2 this option defaults to false. This option is then passed into SQLString library as false. This results in sqlstring parsing objects in a strange way using objectToValues.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | typeorm | all versions | 0.3.26npm install typeorm@0.3.26 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for typeorm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update typeorm to 0.3.26 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-60542 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2025-60542 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2025-60542. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
An attacker able to send a specially crafted JSON payload to an application using the repository.save or repository.update methods can exploit this vulnerability. Additionally, the stringifyObjects option used by TypeORM is set to false by default, increasing the exposure of this issue. Due to these reasons, this flaw…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Developer Hub 1.7 | rhdh/rhdh-hub-rhel9:1.7.3-1764237628 | RHSA-2025:22404 |
| Red Hat Developer Hub 1.8 | rhdh/rhdh-hub-rhel9:1.8.1-1764857949 | RHSA-2025:22861 |
Frequently Asked Questions
Is CVE-2025-60542 in your dependencies?
O3 Security finds CVE-2025-60542 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.