# CVE-2023-37899: feathersjs socket handler allows abusing implicit toString

> An attacker can crash the Node.js process by sending a crafted Socket.io message with an invalid toString property, requiring an upgrade to fix.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Jul 2023
- **Updated:** 28 Oct 2024
- **Also known as:** GHSA-hhr9-rh25-hvf9

## What is CVE-2023-37899?

CVE-2023-37899 is a high-severity denial of service vulnerability in feathersjs feathers, published on 19 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Feathersjs is a framework for creating web APIs and real-time applications with TypeScript or JavaScript. Feathers socket handler did not catch invalid string conversion errors like `const message = ${{ toString: '' }}` which would cause the NodeJS process to crash when sending an unexpected Socket.io message like `socket.emit('find', { toString: '' })`.  A fix has been released in versions 5.0.8 and 4.5.18. Users are advised to upgrade. There is no known workaround for this vulnerability.

Weakness: CWE-754 (Improper Check for Unusual or Exceptional Conditions)

## Which versions are affected by CVE-2023-37899?

8 open source packages ship an affected version, including @feathersjs/socketio and @feathersjs/transport-commons. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@feathersjs/socketio` | npm | All versions | 4.5.18 |
| `@feathersjs/socketio` | npm | All versions | 4.5.18 |
| `@feathersjs/socketio` | npm | From 5.0.0 | 5.0.8 |
| `@feathersjs/socketio` | npm | From 5.0.0 | 5.0.8 |
| `@feathersjs/transport-commons` | npm | All versions | 4.5.18 |
| `@feathersjs/transport-commons` | npm | All versions | 4.5.18 |
| `@feathersjs/transport-commons` | npm | From 5.0.0 | 5.0.8 |
| `@feathersjs/transport-commons` | npm | From 5.0.0 | 5.0.8 |

Products: Feathersjs Feathers.

## How do I fix CVE-2023-37899?

Upgrade @feathersjs/socketio to a fixed version for your release line: 4.5.18 or 5.0.8.

## Is CVE-2023-37899 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-37899 exists.

## Other vulnerabilities in feathersjs feathers

- [CVE-2026-29792](https://insights.sbomify.com/CVE-2026-29792/): Feathersjs has an OAuth Callback Account Takeover (critical 9.3)
- [CVE-2026-29793](https://insights.sbomify.com/CVE-2026-29793/): NoSQL Injection via WebSocket id Parameter in MongoDB Adapter (critical 9.3)
- [CVE-2026-27193](https://insights.sbomify.com/CVE-2026-27193/): Feathers exposes internal headers via unencrypted session cookie (high 8.2)
- [CVE-2026-27192](https://insights.sbomify.com/CVE-2026-27192/): Feathers has an origin validation bypass via prefix matching (high 7.6)
- [CVE-2026-27191](https://insights.sbomify.com/CVE-2026-27191/): Feathers: Open Redirect in OAuth callback enables account takeover (high 7.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-37899 and fix it if it is affected.

What it is: CVE-2023-37899 is a high-severity denial of service vulnerability in feathersjs feathers, published on 19 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-37899 exists.

Affected packages and fixed versions:
- @feathersjs/socketio (npm): affected all versions; fixed in 4.5.18
- @feathersjs/socketio (npm): affected all versions; fixed in 4.5.18
- @feathersjs/socketio (npm): affected from 5.0.0; fixed in 5.0.8
- @feathersjs/socketio (npm): affected from 5.0.0; fixed in 5.0.8
- @feathersjs/transport-commons (npm): affected all versions; fixed in 4.5.18
- @feathersjs/transport-commons (npm): affected all versions; fixed in 4.5.18
- @feathersjs/transport-commons (npm): affected from 5.0.0; fixed in 5.0.8
- @feathersjs/transport-commons (npm): affected from 5.0.0; fixed in 5.0.8

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-37899/ (Markdown: https://insights.sbomify.com/CVE-2023-37899/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-37899
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-37899
- OSV: https://osv.dev/vulnerability/CVE-2023-37899

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-37899/
Summaries are generated and may contain mistakes; the official description above is the record.
