> For the complete documentation index, see [llms.txt](https://reports.immunefi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reports.immunefi.com/ethereum-protocol-or-attackathon/37568-bc-insight-missing-specification-logic.md).

# #37568 \[BC-Insight] missing specification logic

## #37568 \[BC-Insight] Missing Specification Logic

**Submitted on Dec 9th 2024 at 10:53:20 UTC by @Pig46940 for** [**Attackathon | Ethereum Protocol**](https://immunefi.com/audit-competition/ethereum-protocol-attackathon)

* **Report ID:** #37568
* **Report Type:** Blockchain/DLT
* **Report severity:** Insight
* **Target:** <https://github.com/chainsafe/lodestar>
* **Impacts:**
  * (Specifications) A bug in specifications with no direct impact on client implementations

### Description

### Brief/Intro

Lacking the logic which the length of KZG commitments is less than or equal to the limitation defined in Consensus Layer

### Vulnerability Details

Lacking the logic of the following.

The type of the payload of this topic changes to the (modified) SignedBeaconBlock found in Deneb.

\[Modified in Deneb:EIP4844]

New validation:

\[REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer -- i.e. validate that len(body.signed\_beacon\_block.message.blob\_kzg\_commitments) <= MAX\_BLOBS\_PER\_BLOCK

### Impact Details

A bug in specifications with no direct impact on client implementations

### References

## Specs

<https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/p2p-interface.md#beacon\\_block>

## Codes

* <https://github.com/ChainSafe/lodestar/blob/dad9037e7739d5bcbccfe627e715ef40e9ba935b/packages/beacon-node/src/chain/blocks/verifyBlock.ts>
* <https://github.com/ChainSafe/lodestar/blob/dad9037e7739d5bcbccfe627e715ef40e9ba935b/packages/beacon-node/src/chain/blocks/verifyBlocksDataAvailability.ts>

### Proof of Concept

### Proof of Concept

To adhere to the specification, you would need an explicit check like:

if (numBlobs > MAX\_BLOBS\_PER\_BLOCK) {\
throw new BlockError(block0, {\
code: BlockErrorCode.INVALID\_BLOB\_COUNT,\
error: new Error(`Block contains ${numBlobs} blobs, exceeding MAX_BLOBS_PER_BLOCK=${MAX_BLOBS_PER_BLOCK}`),\
});\
}

While the code references and interacts with blobKzgCommitments, it does not implement the specification's requirement to validate the blob count against MAX\_BLOBS\_PER\_BLOCK. Adding the explicit validation step is necessary to ensure compliance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://reports.immunefi.com/ethereum-protocol-or-attackathon/37568-bc-insight-missing-specification-logic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
