Skip to content

fix: reject duplicate service id_suffix in DID registry#62

Merged
aguilar1x merged 1 commit into
devfrom
fix/registry-duplicate-service-id
Jun 16, 2026
Merged

fix: reject duplicate service id_suffix in DID registry#62
aguilar1x merged 1 commit into
devfrom
fix/registry-duplicate-service-id

Conversation

@aguilar1x

@aguilar1x aguilar1x commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

validate_record in did-stellar-registry validated each service individually but never checked that id_suffix was unique across the services array. Two services sharing an id_suffix resolve to the same {did}#service-{id_suffix} fragment, producing an ambiguous DID Document (different resolvers may pick the first/last match → endpoint confusion).

This adds a uniqueness check: duplicate id_suffix values are now rejected with a new DuplicateServiceId error. The comparison is pairwise and bounded by MAX_SERVICE_COUNT (3), so it is cheap.

(Security review finding: duplicate service IDs allow ambiguous DID documents.)

Changes

  • New error RegistryError::DuplicateServiceId = 21.
  • validate_record rejects services with duplicate id_suffix.

@almanax-ai

almanax-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Plan expired

Your subscription has expired. Please renew your subscription to continue using CI/CD integration and other features.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aguilar1x, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 20 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 76c5426a-d24d-4eba-9981-1a1dfb53b73f

📥 Commits

Reviewing files that changed from the base of the PR and between fc9f26d and a04ade0.

📒 Files selected for processing (3)
  • contracts/did-stellar-registry/src/contract.rs
  • contracts/did-stellar-registry/src/errors.rs
  • contracts/did-stellar-registry/src/test.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/registry-duplicate-service-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aguilar1x aguilar1x self-assigned this Jun 16, 2026
@aguilar1x aguilar1x merged commit 872d942 into dev Jun 16, 2026
4 checks passed
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.

1 participant