lambdaclass / lambdaclass/eth-agent

Address case sensitivity handled inconsistently

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug high-priority
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

Address comparison and normalization is inconsistent across the codebase. Some places use toLowerCase(), others don't, leading to potential mismatches.

Locations

  • src/protocol/account.ts:231, 236, 268 - uses toLowerCase()
  • Other comparison points may not normalize

Impact

  • Address comparisons could fail unexpectedly
  • Same address in different cases treated as different
  • Potential security issues with allowlists/blocklists

Recommendation

  1. Create a normalizeAddress() helper function
  2. Use it consistently throughout the codebase
  3. Consider using checksummed addresses (EIP-55) as canonical form
export function normalizeAddress(address: string): Address {
  // Validate and return checksummed address
  if (!isValidAddress(address)) {
    throw new InvalidAddressError(address);
  }
  return toChecksumAddress(address) as Address;
}

Priority

High - Correctness issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review src/protocol/account.ts at lines 231, 236, and 268, then search the codebase for other address comparison points. The work is done when address comparisons use a consistent normalization approach, including validation and checksummed canonicalization if adopted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.