mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 08:49:38 +03:00
[PR #1012] [CLOSED] feat: RFC 8252 loopback interface redirection support #1023
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/1012
Author: @savely-krasovsky
Created: 10/8/2025
Status: ❌ Closed
Base:
main← Head:rfc8252-special-case📝 Commits (3)
0e96991feat: RFC 8252 loopback interface redirection supportb826867Merge branch 'main' into rfc8252-special-case3fc9f0bMerge branch 'main' into rfc8252-special-case📊 Changes
3 files changed (+118 additions, -18 deletions)
View changed files
📝
backend/internal/service/oidc_service.go(+2 -18)📝
backend/internal/utils/string_util.go(+48 -0)📝
backend/internal/utils/string_util_test.go(+68 -0)📄 Description
Support for special Callback URL case which is primary used by Desktop Native Applications.
https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
Their unique feature is that they can use any ephemeral port they want. So it could be 23821 or 54231. Of course they send it in
redirect_url. Until recently it was possible to sethttp://127.0.0.1:*andhttp://[::1]:*(orhttp://localhost:*) to work around this but now it's impossible due to the new form validation:But still it presets a huge vulnerability, since
http://localhost:*basically allows to craft authorization URL with callback URL like this:http://localhost:password@malicious-host.com/authorization_code_stealer.Fortunately RFC 8252 defines this special case by specifying that ephemeral port could be completely random and authorization server should allow any arbitrary port.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.