CVE-2021-45698
RPC call failure in ckb
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
- Record
CVE-2021-45698- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Updated
- 2026-11-02
CVE List No score
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
- Record
CVE-2021-45698- Updated
- 2026-11-02
EUVDEUVD-2022-0528 No score
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
- Record
EUVD-2022-0528- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-8gjm-h3xj-mp6w
9.8
RPC call failure in ckb
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
- Record
GHSA-8gjm-h3xj-mp6w- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-v666-6w97-pcwm No score
Miner fails to get block template when a cell used as a cell dep has been destroyed.
Impact
The RPC get_block_template fails when a cell has been used as a cell dep and an input in the different transactions.
Say cell C is used as a dep group in the transaction A, and is destroyed in the transaction B.
The node adds transaction A first, then B into the transaction pool. They are both valid. But when generating the block template, if the fee rate of B is higher, it comes before A, which will invalidate A. Currently the RPC get_block_template will fail instead of dropping A.
Patch
First, the get_block_template should not fail but dropping the conflict transactions.
Then we can propose solution to this issue. Here is an example. When a transaction is added to the pool, the pool must consider it depending on all the transactions which dep cell (direct or indirect via dep group) has been destroyed in this transaction. Because future transactions using the destroyed cells as dep will be rejected, the spending transaction only need to wait for all the existing dep transactions on chain.
Workaround
- Submit transaction B when A is already on chain.
- Let B depend on A explicitly, there are several solutions:
- a. Add any output cell on A as a dep cell or input in B.
- b. Merge A and B. CKB allows using the same cell as both dep and input in the same transaction.
- Ensure the fee rate of B is less than A so A always has higher priority.
- Record
GHSA-v666-6w97-pcwm- Weakness
- CWE-367
- Updated
- 2026-11-02
OSVGHSA-8gjm-h3xj-mp6w
9.8
RPC call failure in ckb
An issue was discovered in the ckb crate before 0.40.0 for Rust. A get_block_template RPC call may fail in situations where it is supposed to select a Nervos CKB blockchain transaction with a higher fee rate than another transaction.
- Record
GHSA-8gjm-h3xj-mp6w- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-v666-6w97-pcwm No score
Miner fails to get block template when a cell used as a cell dep has been destroyed.
Impact
The RPC get_block_template fails when a cell has been used as a cell dep and an input in the different transactions.
Say cell C is used as a dep group in the transaction A, and is destroyed in the transaction B.
The node adds transaction A first, then B into the transaction pool. They are both valid. But when generating the block template, if the fee rate of B is higher, it comes before A, which will invalidate A. Currently the RPC get_block_template will fail instead of dropping A.
Patch
First, the get_block_template should not fail but dropping the conflict transactions.
Then we can propose solution to this issue. Here is an example. When a transaction is added to the pool, the pool must consider it depending on all the transactions which dep cell (direct or indirect via dep group) has been destroyed in this transaction. Because future transactions using the destroyed cells as dep will be rejected, the spending transaction only need to wait for all the existing dep transactions on chain.
Workaround
- Submit transaction B when A is already on chain.
- Let B depend on A explicitly, there are several solutions:
- a. Add any output cell on A as a dep cell or input in B.
- b. Merge A and B. CKB allows using the same cell as both dep and input in the same transaction.
- Ensure the fee rate of B is less than A so A always has higher priority.
- Record
GHSA-v666-6w97-pcwm- Weakness
- CWE-367
- Updated
- 2026-11-02
OSVRUSTSEC-2021-0107 No score
Miner fails to get block template when a cell used as a cell dep has been destroyed.
Impact
The RPC get_block_template fails when a cell has been used as a cell dep and an input in the different transactions.
Say cell C is used as a dep group in the transaction A, and is destroyed in the transaction B.
The node adds transaction A first, then B into the transaction pool. They are both valid. But when generating the block template, if the fee rate of B is higher, it comes before A, which will invalidate A. Currently the RPC get_block_template will fail instead of dropping A.
Patch
First, the get_block_template should not fail but dropping the conflict transactions.
Then we can propose solution to this issue. Here is an example. When a transaction is added to the pool, the pool must consider it depending on all the transactions which dep cell (direct or indirect via dep group) has been destroyed in this transaction. Because future transactions using the destroyed cells as dep will be rejected, the spending transaction only need to wait for all the existing dep transactions on chain.
Workaround
Submit transaction B when A is already on chain.
Let B depend on A explicitly, there are several solutions:
a. Add any output cell on A as a dep cell or input in B.
b. Merge A and B. CKB allows using the same cell as both dep and input in the same transaction.
Ensure the fee rate of B is less than A so A always has higher priority.
- Record
RUSTSEC-2021-0107- Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-45698 is a critical vulnerability (CVSS 9.8) in Nervos Ckb, published July 25, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.23%, the 69th percentile. Fixed in ckb 0.40.0.
References
rustsec.org/advisories/RUSTSEC-2021-0107.html
raw.githubusercontent.com/rustsec/advisory-db/main/crates/ckb/RUSTSEC-2021-0107.md
nvd.nist.gov/vuln/detail/CVE-2021-45698
github.com/nervosnetwork/ckb/security/advisories/GHSA-v666-6w97-pcwm
github.com/advisories/GHSA-8gjm-h3xj-mp6w
github.com/advisories/GHSA-v666-6w97-pcwm
github.com/nervosnetwork/ckb
crates.io/crates/ckb
github.com/nervosnetwork/ckb/commit/e5b45795375d7dc2a689fb46790caca5c2653638