Skip to content

Don't redirect to PhoneQuestion from HybridHandoff if referer is nil#9472

Closed
soniaconnolly wants to merge 1 commit intomainfrom
sonia-phone-question-no-referer
Closed

Don't redirect to PhoneQuestion from HybridHandoff if referer is nil#9472
soniaconnolly wants to merge 1 commit intomainfrom
sonia-phone-question-no-referer

Conversation

@soniaconnolly
Copy link
Contributor

@soniaconnolly soniaconnolly commented Oct 27, 2023

We see that referer is nil if the user tries to visit idv_link_sent_url while still on HybridHandoff. Not sure why, but web search indicates that the user can turn off referer in the HTTP header, which would cause a redirect loop in #maybe_redirect_for_phone_question_ab_test. So this adds a check for nil referer in that method.

Discovered while doing local testing for #9465

Research links:
https://api.rubyonrails.org/v5.0.1/classes/ActionController/Redirecting.html
https://blog.mozilla.org/security/2015/01/21/meta-referrer/

NOTE: we are reconsidering our life choices and may just re-implement #maybe_redirect_for_phone_question_ab_test to depend on a session value

We see that referer is nil if the user tries to visit idv_link_sent_url while still on
HybridHandoff. Not sure why, but web search indicates that the user can turn off referer
in the HTTP header, which would cause a redirect loop in #maybe_redirect_for_phone_question_ab_test.
So this adds a check for nil referer in that method.

[skip changelog]

Co-authored-by: Doug Price <douglas.price@gsa.gov>
Co-authored-by: Amir Reavis-Bey <amir.reavis-bey@gsa.gov>
Co-authored-by: Jessica Dembe: <jessica.dembe@gsa.gov>
@soniaconnolly soniaconnolly requested a review from amirbey October 27, 2023 18:17
@soniaconnolly soniaconnolly marked this pull request as draft October 27, 2023 20:25
@soniaconnolly
Copy link
Contributor Author

Closed in favor of refactor in #9461

@soniaconnolly soniaconnolly deleted the sonia-phone-question-no-referer branch December 2, 2023 01:05
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

Successfully merging this pull request may close these issues.

1 participant