Skip to content

Address openid session crashes on invalid input - #592

Merged
jonasbardino merged 4 commits into
nextfrom
fix/openid-session-crashes-on-invalid-input
Jul 28, 2026
Merged

Address openid session crashes on invalid input#592
jonasbardino merged 4 commits into
nextfrom
fix/openid-session-crashes-on-invalid-input

Conversation

@jonasbardino

@jonasbardino jonasbardino commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Attempt to address #589 with more robust handling of various errors and especially the input validation ones. Show a generic error page and only write log warnings rather than errors in that case.
Check the openid library could in fact decode user query to a request before using the result in order to avoid some NoneType object attribute errors when it couldn't.

Some generic lint fixes and polish of error messages to properly show support email.

especially the input validation ones. Show a generic error page and only write
log warnings rather than errors in that case.
Check the openid library could in fact decode user query to a request before
using the result in order to avoid some NoneType object attribute errors when
it couldn't.
Removed unused parent openid module import and left it to the openid.x module
imports to fail hard if missing.
@jonasbardino jonasbardino self-assigned this Jul 15, 2026
@jonasbardino jonasbardino added the bug Something isn't working label Jul 15, 2026
@jonasbardino jonasbardino added this to the OpenID Connect Support milestone Jul 15, 2026
@jonasbardino jonasbardino linked an issue Jul 15, 2026 that may be closed by this pull request
@jonasbardino jonasbardino added the battle-tested Code was tested to be fully functional in line with project code guidelines. label Jul 15, 2026
@jonasbardino

jonasbardino commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Hmm, not sure why the linting currently fails with just the very unhelpful Error: message. Neither pylint nor ruff complain when running locally.

UPDATE: the above turned out to be my browser settings preventing full page load and now I can see that it's just one of the old lint errors covered in #338.

@jonasbardino
jonasbardino marked this pull request as ready for review July 15, 2026 09:41
@jonasbardino
jonasbardino requested a review from a team July 15, 2026 09:41
Comment thread mig/server/grid_openid.py
Comment thread mig/server/grid_openid.py
Comment thread mig/server/grid_openid.py
Comment thread mig/server/grid_openid.py
Comment thread mig/server/grid_openid.py
Comment thread mig/server/grid_openid.py Outdated
Comment thread mig/server/grid_openid.py Outdated

@Martin-Rehr Martin-Rehr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with a few comments

@jonasbardino
jonasbardino merged commit c949187 into next Jul 28, 2026
9 of 11 checks passed
@jonasbardino
jonasbardino deleted the fix/openid-session-crashes-on-invalid-input branch July 28, 2026 12:49
jonasbardino added a commit that referenced this pull request Jul 30, 2026
…rict and

avoid greedy swallowing of ValueError triggered outside the actual validation.
This is follow-up to #592 in relation to the post-merge discussion there.

Add 'better safe than sorry' validation of all query components.

Switch `invalid_argument` helper to reusing `InputException` to let exception
handlers focus on that kind only.

Avoid potential clashes with 2nd (key, val)-iterator in same scope.
jonasbardino added a commit that referenced this pull request Jul 30, 2026
…rict after PR592 (#634)

* Rework the built-in openid 2.0 service input validation to be more strict and
avoid greedy swallowing of ValueError triggered outside the actual validation.
This is follow-up to #592 in relation to the post-merge discussion there.

Add 'better safe than sorry' validation of all query components.

Switch `invalid_argument` helper to reusing `InputException` to let exception
handlers focus on that kind only.

Avoid potential clashes with 2nd (key, val)-iterator in same scope.
jonasbardino added a commit that referenced this pull request Aug 18, 2026
…hitting

openid message objects that it doesn't know what to do about. Force to string
to make it succeed.
jonasbardino added a commit that referenced this pull request Aug 18, 2026
…hitting

openid message objects that it doesn't know what to do about. Force to string
to make it succeed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

battle-tested Code was tested to be fully functional in line with project code guidelines. bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenID service session crashes on invalid GET request

2 participants