Skip to content

Client Schema URI scheme validation: Custom protocol validation logic is too simplistic for native apps #1411

@shahbazshueb

Description

@shahbazshueb

What happened?

In lib/helpers/client_schema.js, the check for custom URI schemes in native client redirect URIs (see code link) uses if (!protocol.includes('.')) to enforce reverse domain naming. This logic is too simplistic and may:

  • Incorrectly reject valid single-word custom schemes (e.g. myapp:)
  • Incorrectly accept invalid or poorly structured schemes
  • Not correctly enforce the intended reverse domain naming requirement (and protocol includes the colon suffix)

Expected:
The validator should robustly check for the reverse domain naming scheme according to OAuth 2.0 Native App Best Current Practice and reject schemes that do not comply.

Actual:
Currently, any protocol containing a dot passes; any without is rejected, regardless of actual URI structure.

See also: Relevant Code

Version

v9.8.0

Runtime Details

Nodejs v22, macOS

Configuration

Minimal provider config:

{
  application_type: 'native',
  redirect_uris: ['myapp://callback'] // or try 'com.example.app://callback'
}

Steps to reproduce

  1. Configure a native app client with various custom URI schemes as redirect URIs.
  2. Attempt to register schemes both with and without dots (e.g. cursor://callback, myapp://callback, com.example.app://callback, etc)
  3. Observe validation behavior for each.
  4. Expected: Only reverse domain name based schemes should be accepted.
  5. Actual: Any protocol with a dot is accepted; others are rejected regardless of actual structure.

Required

  • I understand this issue tracker is for bug reports only. Questions and support requests will be closed and eventually deleted.
  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions