MerkleTrie.sol#L185-L188
In MerkleTrie, the function _walkNodePath() retrieves the value node by walking through the proof array with the key and verify its inclusion in the proof.
When currentKeyIndex == key.length, it terminates the loop and returns, as it has reached the end of the key and found the value node for the key (as show below).
However, it fails to check that there are no more un-used proof elements in the proof array before terminating in that situation. That is because the proof is considered invalid if it contains more proof elements than what is required to verify the key and value node.
This differs from a recent version of OPs MerkleTrie.sol#L111-L112, where it will check that it has reached the end of the proof array when the value node is found.
Consider adding the i == proof.length - 1 check in _walkNodePath().
Fixed here.
Resolved as per recommendations.
