Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit OAuth client validation #67

Open
wmurphyrd opened this issue May 6, 2022 · 0 comments
Open

Revisit OAuth client validation #67

wmurphyrd opened this issue May 6, 2022 · 0 comments

Comments

@wmurphyrd
Copy link
Member

wmurphyrd commented May 6, 2022

The current logic looks for a client with a registered redirectUri that matches exactly the protocol & host portion of the requested redirectUri. It was setup this way so that having a room id in the path wouldn't prevent validation (e.g. Hubs rooms), but I have two concerns:

  1. If the hub value from the config contain any path, then it can never be matched. While this isn't a documented way of specifying the hub domain, setting hub to e.g. immerdomain.com/index.html works in all other respects for using a static site served by the immer as the hub (https://github.com/immers-space/nice-free-treasures)
  2. There may be potential for abuse if another app could get deployed on the same host (maybe some shared hosting service situation) and could then impersonate other clients on the host
      const url = new URL(redirectUriFull)
      const redirectUri = `${url.protocol}//${url.host}`
      const client = await db.collection('clients').findOne({ clientId, redirectUri })

immers/src/authdb.js

Lines 89 to 91 in 015814e

const url = new URL(redirectUriFull)
const redirectUri = `${url.protocol}//${url.host}`
const client = await db.collection('clients').findOne({ clientId, redirectUri })

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

No branches or pull requests

1 participant