Skip to content

feat(oauth2): strict string matching for redirect_uri#82294

Closed
oioki wants to merge 2 commits into
masterfrom
feat/oauth2-strict-redirect-uri
Closed

feat(oauth2): strict string matching for redirect_uri#82294
oioki wants to merge 2 commits into
masterfrom
feat/oauth2-strict-redirect-uri

Conversation

@oioki

@oioki oioki commented Dec 18, 2024

Copy link
Copy Markdown
Member

Enforcing strict string matching for redirect_uri for more secure OAuth2 flows according to best practices:

@oioki oioki requested a review from a team December 18, 2024 09:47
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 18, 2024
assert app.is_valid_redirect_uri("http://example.com/.")
assert app.is_valid_redirect_uri("http://example.com//")
assert app.is_valid_redirect_uri("http://example.com/biz/baz")
assert not app.is_valid_redirect_uri("http://example.com//")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First three examples are normalized to / by user agents. However, the last one is //, considered a different URL:

$ curl -v http://example.com/ 2>&1 | grep GET
> GET / HTTP/1.1
$ curl -v http://example.com 2>&1 | grep GET
> GET / HTTP/1.1
$ curl -v http://example.com/. 2>&1 | grep GET
> GET / HTTP/1.1
$ curl -v http://example.com// 2>&1 | grep GET
> GET // HTTP/1.1

assert app.is_valid_redirect_uri("http://sub.example.com/path")
assert app.is_valid_redirect_uri("http://sub.example.com/path/")
assert app.is_valid_redirect_uri("http://sub.example.com/path/bar")
assert not app.is_valid_redirect_uri("http://sub.example.com/path/")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When it's not root of the domain, then the path with and without slash are considered different:

$ curl -v http://example.com/path 2>&1 | grep GET
> GET /path HTTP/1.1
$ curl -v http://example.com/path/ 2>&1 | grep GET
> GET /path/ HTTP/1.1

@getsantry

getsantry Bot commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added Stale and removed Stale labels Jan 9, 2025
@getsantry

getsantry Bot commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Feb 6, 2025
@codecov

codecov Bot commented Feb 6, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #82294      +/-   ##
==========================================
+ Coverage   87.60%   87.65%   +0.04%     
==========================================
  Files        9647     9502     -145     
  Lines      545335   543030    -2305     
  Branches    21428    21009     -419     
==========================================
- Hits       477732   475983    -1749     
+ Misses      67260    66641     -619     
- Partials      343      406      +63     

@getsantry getsantry Bot removed the Stale label Feb 7, 2025
@getsantry getsantry Bot added Stale and removed Stale labels Jun 6, 2025
@getsantry getsantry Bot added Stale and removed Stale labels Jun 29, 2025
@getsantry

getsantry Bot commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added Stale and removed Stale labels Jul 22, 2025
@getsantry

getsantry Bot commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added Stale and removed Stale labels Aug 14, 2025
@getsantry getsantry Bot added the Stale label Sep 6, 2025
@getsantry

getsantry Bot commented Sep 6, 2025

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot removed the Stale label Sep 7, 2025
@oioki

oioki commented Sep 10, 2025

Copy link
Copy Markdown
Member Author

Superceded by #99003

@oioki oioki closed this Sep 10, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant