Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: validate that fid on username add message matches fid on ens proof #2378

Merged

Conversation

aditiharini
Copy link
Contributor

@aditiharini aditiharini commented Oct 24, 2024

This fixes a bug which allows an users to assume an arbitrary user's ens name as their own.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review


PR-Codex overview

This PR focuses on enhancing the validation of fid in user data messages to ensure that it matches the fid associated with the username proof, specifically for fname and ENS types.

Detailed summary

  • Updated validation logic in index.ts to check if fid matches for fname and ENS username types.
  • Added error handling for invalid username types.
  • Introduced a new test case in index.test.ts to verify failure when fid on message does not match fid on ENS name proof.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Oct 24, 2024

🦋 Changeset detected

Latest commit: 205a357

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@farcaster/hubble Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 6:14pm

@aditiharini aditiharini added the t-bug A fix for a bug with the current system label Oct 24, 2024
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 44.19%. Comparing base (1880070) to head (205a357).
Report is 407 commits behind head on main.

Files with missing lines Patch % Lines
apps/hubble/src/storage/engine/index.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2378       +/-   ##
===========================================
- Coverage   74.05%   44.19%   -29.87%     
===========================================
  Files          99      146       +47     
  Lines        9425    26208    +16783     
  Branches     2097     9364     +7267     
===========================================
+ Hits         6980    11583     +4603     
- Misses       2327    12832    +10505     
- Partials      118     1793     +1675     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aditiharini aditiharini merged commit c2140e2 into farcasterxyz:main Oct 24, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-bug A fix for a bug with the current system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants