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
- Configure a native app client with various custom URI schemes as redirect URIs.
- Attempt to register schemes both with and without dots (e.g.
cursor://callback, myapp://callback, com.example.app://callback, etc)
- Observe validation behavior for each.
- Expected: Only reverse domain name based schemes should be accepted.
- Actual: Any protocol with a dot is accepted; others are rejected regardless of actual structure.
Required
What happened?
In
lib/helpers/client_schema.js, the check for custom URI schemes in native client redirect URIs (see code link) usesif (!protocol.includes('.'))to enforce reverse domain naming. This logic is too simplistic and may:myapp:)protocolincludes 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
Steps to reproduce
cursor://callback,myapp://callback,com.example.app://callback, etc)Required