# GHSA-j35p-q24r-5367: Dep Group Remote Memory Exhaustion (Denial of Service) in ckb

> Remote attackers can exhaust memory in CKB nodes by sending transactions with duplicate outpoints, causing denial of service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Apr 2022

## What is GHSA-j35p-q24r-5367?

GHSA-j35p-q24r-5367 is a denial of service vulnerability in ckb, published on 22 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
A remote attacker could exploit this vulnerability to exhaust ckb process memory of an affected node.

### Patches
Upgrade to 0.43.1 or later.

### References
After resolving the outpoints of one dep group, we put the corresponding content into a vec ( https://github.com/nervosnetwork/ckb/blob/v0.42.0/util/types/src/core/cell.rs#L600-L617 ), there is a vulnerability to a memory dos attack because there is no determination of whether the outpoints is duplicated.

PoC:
```
before send dos tx rss:
105700

after rss:
2306932
```

DoS cost: 25.6 KB * 150 + dep_tx out_points capacity ( 36 * 150 * 100 = 540000 ) = 4380000 CKB
Send 50 dos_tx, memory exhausted: (25.6 KB * 150  * 100) * 50 = 19.2 GB

## Which versions are affected by GHSA-j35p-q24r-5367?

2 open source packages ship an affected version, including ckb.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ckb` | crates.io | All versions | 0.43.1 |
| `ckb` | crates.io | All versions | 0.43.1 |

## How do I fix GHSA-j35p-q24r-5367?

Upgrade ckb to 0.43.1 or later.

## Is GHSA-j35p-q24r-5367 being exploited?

There is no known exploitation of GHSA-j35p-q24r-5367 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-j35p-q24r-5367 and fix it if it is affected.

What it is: GHSA-j35p-q24r-5367 is a denial of service vulnerability in ckb, published on 22 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-j35p-q24r-5367 in the wild and no public exploit code.

Affected packages and fixed versions:
- ckb (crates.io): affected all versions; fixed in 0.43.1
- ckb (crates.io): affected all versions; fixed in 0.43.1

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/GHSA-j35p-q24r-5367/ (Markdown: https://insights.sbomify.com/GHSA-j35p-q24r-5367/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-j35p-q24r-5367

---
From sbomify Insights: https://insights.sbomify.com/GHSA-j35p-q24r-5367/
Summaries are generated and may contain mistakes; the official description above is the record.
