Skip to content

Conversation

@highskore
Copy link
Contributor

No description provided.

@highskore highskore requested review from kopy-kat and removed request for kopy-kat July 2, 2025 14:43
@highskore highskore requested review from Copilot and kopy-kat July 2, 2025 15:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors WebAuthnValidator to streamline credential ID parameters, enforce sorted and unique IDs, and update tests accordingly.

  • Removed the requireUV parameter from generateCredentialId, removeCredential, and hasCredential methods.
  • Introduced a NotSorted error and added checks to ensure credential ID arrays are sorted and uniquified.
  • Bumped the Solidity compiler version to ^0.8.28 and updated unit and integration tests to match signature changes.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/WebAuthnValidator/unit/concrete/WebAuthnValidator.t.sol Updated test calls to remove requireUV, added sorting imports, and adjusted array ordering.
test/WebAuthnValidator/integration/WebAuthnValidator.t.sol Aligned integration tests with new method signatures and data encoding.
src/WebAuthnValidator/WebAuthnValidator.sol Removed requireUV usage, added NotSorted error, enforced sorted IDs, and bumped compiler.
foundry.toml Updated compiler setting from 0.8.25 to 0.8.28.
Comments suppressed due to low confidence (4)

src/WebAuthnValidator/WebAuthnValidator.sol:210

  • The contract uses isSorted() without importing or attaching the LibSort library. Add import { LibSort } from "solady/utils/LibSort.sol"; and using LibSort for bytes32[]; at the top of the file.
        require(credentialIds.isSorted(), NotSorted());

src/WebAuthnValidator/WebAuthnValidator.sol:497

  • Same issue: switch to if (!context.credentialIds.isSortedAndUniquified()) revert NotSorted(); and ensure LibSort is imported and applied.
        require(context.credentialIds.isSortedAndUniquified(), NotSorted());

test/WebAuthnValidator/unit/concrete/WebAuthnValidator.t.sol:13

  • [nitpick] The console import is not used in this test. Remove it to clean up unnecessary dependencies.
import { console } from "forge-std/console.sol";

test/WebAuthnValidator/unit/concrete/WebAuthnValidator.t.sol:20

  • [nitpick] The LibSort library is imported but not utilized here; either remove the import/using directive or apply its sort() method instead of manual swaps.
    using LibSort for bytes32[];

@highskore highskore requested a review from zeroknots July 9, 2025 08:36
@highskore highskore requested a review from zeroknots July 10, 2025 09:18
@highskore highskore merged commit c1511a8 into main Jul 17, 2025
2 of 16 checks passed
@highskore highskore deleted the feat/audit-remediations branch July 17, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants