Skip to content

Registry report targetAddress accepts any non-empty string, not just valid Stellar addresses #2

Description

@pitah23

Problem

isValidStellarAddress() exists in src/shared/stellar.ts but is never called anywhere. POST /v1/registry validates targetAddress with only z.string().min(1) (src/api/routes/registry.ts), and fileReport() (src/registry/reports.ts) only checks truthiness. Garbage addresses can be filed, endorsed, confirmed, and propagated to the scan cache / anchored on-chain via anchorRegistryFlag, polluting the registry and wasting an on-chain anchor transaction.

Location

  • src/api/routes/registry.ts (fileReportSchema)
  • src/registry/reports.ts (fileReport)
  • Unused: src/shared/stellar.ts#isValidStellarAddress

Suggested fix

Validate targetAddress with isValidStellarAddress() in the route's Zod schema (e.g. .refine(isValidStellarAddress)) before it ever reaches fileReport.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions