Solved

How do I determine where a response.redirect came from?

Posted on 2009-04-10
10
312 Views
Last Modified: 2012-05-06
I have a web site that I use to redirect a member to another website via https.  Because I use a response.redirect there is no HTTP_Referer available for the receiving site to validate that the reqeust came from my site.  Have tried to add a Resposne.AppendHeader prior to the response.redirect with no joy.  What can I do to ensure the request came from my site?
if (ConfigurationManager.AppSettings["Mask"].ToString().ToLower() == "true")

                {

                sbURL.Append(encryptQueryString(_EDIPI));

                Response.AppendHeader ("ReserveHeader","navyreserve.navy.mil");

                Response.Redirect(sbURL.ToString());

                }

                else

                {

                sbURL.Append(_EDIPI);

                Response.AppendHeader("ReserveHeader", "navyreserve.navy.mil");

                Response.Redirect(sbURL.ToString());

                }

Open in new window

0
Comment
Question by:mbart
  • 5
  • 5
10 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> What can I do to ensure the request came from my site?
add a query parameter to all of your links
0
 

Author Comment

by:mbart
Comment Utility
Is this the same as the querystring?  I pass an encrypted id via a querystring, but the receiving site wants to be sure it came from my site and not just a cut and paste of the url.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> .. ^wants to be sure it came from my site and not just a cut and paste of the url.
Could you explain how a link "comes from your site" differs from copying the same link in the URL bar?
0
 

Author Comment

by:mbart
Comment Utility
When a hyperlink is clicked the HTTP_Referer reflects the URL of the requesting (referring) site.  When it  is a cut and past there is no HTPP_Referer. This is what is the crux of my problem as I don't want to use a link, as I want to use a popup window and not show the query string if at all possible.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> When it  is a cut and past there is no HTPP_Referer.
and if the link was c&p and the referer added manually (proxy or whatever), how would you distinguish that?
The referer header is 101% unreliable.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:mbart
Comment Utility
I am well aware that the Http_referer is not reliable, but the question remains, is it possible to tell if the request came from my site vice someother place?
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> .. is it possible ..
if you mean "reliable" when writing "possible", then the answer is no
otherwise the answer is sometimes yes by checking the Referer header
0
 

Author Comment

by:mbart
Comment Utility
If no link is used ie; the request is generated from code, see code provided,  there is no Referer header which is why the question was posted in the beginning.  I have tried doing a add.header but that doesn't work as it doesn't show on my fully patched web front end.  Beginning to think there is no solution for this.  I am currently using a query string but that is not very reliable either.  Just looking for a way to determine the url the request is coming from.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
Comment Utility
there're infinite tools which can perform a request, and most of them can use whaterver you like (and even what you cannot imagine:) as referer
So there is no reliable way to "determine the url the request is coming from".
0
 

Author Closing Comment

by:mbart
Comment Utility
Thanks I will see what I can find, everything I have found so far says that a Microsoft patch has plugged the use of added headers.  But I will limp along with what I have.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now