Roleless OAuth session can inherit a role when a matching account is created later
Maintainers usually reply within 1 day
@heskew is already working on this.
Since Oct 2, 2026.
Assessment
This issue has not been assessed yet.
Description
Surfaced during #231's §3 design review. It's out of scope there because it's a property of how sessions resolve over time, not of adoption-time trust.
Problem. A trusted login whose username has no matching hdb_user still gets a raw, roleless session identity. Harper sessions don't expire. So someone who controls an email today can log in once and keep that session indefinitely. If an administrator later creates an hdb_user with the same username for an unrelated reason, the held session silently inherits that user's role. Nothing checks the session's identity again when it's resolved to a role later.
Goal. A session created before its username existed as an account must not gain that account's role later. Options to evaluate in a design note:
- Record in the session whether an account existed when it was created, along with the stable identity binding from #231 §3. Refuse role resolution when the account was created after the session, or when the binding doesn't match.
- Don't persist a session at all for unmatched trusted logins unless the app opts in through a hook.
- Rely on #231 §3's
oauth_identitiesbinding gate on every privileged-session path. Check whether that already covers it, or whether role resolution in core bypasses it.
Interactions.
- #231 §1 (neutralizing sessions from before the gate).
- #231 §3 (the binding gate).
- Possibly core session-to-role resolution. If the fix needs core, file a linked harper issue.
Tests:
- A roleless trusted session is created.
- An admin then creates an
hdb_userwith that username. - The held session does not gain the role.
- A fresh login goes through the normal adoption gate.
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/oauth
-
Open-issue triage and roadmap (post-2.9.0)Possibly taken @heskew claimed this 14 days ago. Open
HarperFast/oauth#278 · 1 assignee ·
Maintainers usually reply within 1 day
-
Session docs overstate expiry: no default lifetime, and invalidation clears fields rather than deleting the rowPossibly taken @heskew claimed this 14 days ago. Open
HarperFast/oauth#277 · 1 assignee ·
Maintainers usually reply within 1 day
-
Azure ?appid= form of the shared-alias keys URL isn't recognizedPossibly taken @heskew claimed this 14 days ago. Open
HarperFast/oauth#275 · 1 assignee ·
Maintainers usually reply within 1 day
-
Azure multi-tenant: allow account adoption for an allowlist of tenants without restricting sign-inPossibly taken @heskew claimed this 14 days ago. Open
HarperFast/oauth#272 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
HarperFast/oauth#258 ·
Maintainers usually reply within 1 day
All issues in HarperFast/oauth
Similar issues
-
BUG
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
flarum/framework#5231 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/rocketmq-dashboard#6896 ·
Maintainers usually reply within 3 days
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[workshop-sync] workshop/side-quest-17-06-output-injection.md: stale add_comment.cjs line referencesOpendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
githubnext/gh-aw-workshop#4679 ·
Maintainers usually reply within 1 day