base / base/nitro-validator

_loadVerified assembly offsets are still wrong on main (PR #37 fix was not applied)

Open Beginner friendly
#50 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Solidity
Stars
48
Forks
42
PR merge metrics
No merged PRs in 30d

Description

This was fixed in PR #37 but the PR was closed without merging. The fix was never applied to main.

`src/CertManager.sol` lines 581-584 still have wrong offsets:

```solidity
ca := mload(add(packed, 0x1)) // should be 0x0
notAfter := mload(add(packed, 0x9)) // should be 0x1
maxPathLen := mload(add(packed, 0x11)) // should be 0x9
subjectHash := mload(add(packed, 0x31)) // should be 0x11
```

`abi.encodePacked` layout: ca(1) || notAfter(8) || maxPathLen(8) || subjectHash(32) || pubKey(48)

The warm cache path calls `_loadVerified` for every previously verified cert. With wrong offsets, cached certs return garbage values for ca, notAfter, maxPathLen and subjectHash. This affects the NitroValidator flow via `verifyCachedCertBundle`.

Fix diff in PR #37: https://github.com/base/nitro-validator/pull/37

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/CertManager.sol at lines 581-584 and trace the verifyCachedCertBundle path that calls _loadVerified. Compare the mload offsets with the documented abi.encodePacked layout and the fix described in PR #37; done means cached certificates return the correct ca, notAfter, maxPathLen, and subjectHash values.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.