What are some HTTP Get recommendations for security?
When should HTTP get querystring values be hidden?
Change The legacy application has all of the XOR 'encrypted' request parameters. It also passes things like AccountID in the query string. So I wonder if this is good practice and how I will correct these things if they are not.
Edit -
One of the methods that I could use to solve this issue would be to create a base class (this is just pseudocode):
public mustinherit class QSBase public shared Unique as long = 0 private m_ID as string public readonly property ID get return m_ID end get end property public sub new() m_ID = Unique 'somehow get a unique value for this querystring Unique += 1 end sub public function IDQueryString() as string return "ID=" & m_ID end function end class
Then, for each page in the application, I would create a derived class with properties for each query string value.
public class QSPage1 inherits QSBase private m_AccountID as string public readonly property AccountID as string get return m_AccountID end get end property public sub new(byval _AccountID as string) m_AccountID = _AccountID end sub end class
Then, when I pass the query string to pop-ups or other pages, I add the appropriate class, save it in the session and pass the unique identifier in the query string
Dim qs as new QSPage1("123456") Session(qs.ID) = qs Server.Transfer("Page1.aspx?" & qs.IDQueryString()) 'or CreatePopup("Page1.aspx?" & qs.IDQueryString())
Inside the page, I access the values by pulling a unique identifier and referring to the saved session value:
AccountID = CType(Session(Request.QueryString("ID")), QSPage1).AccountID()
Of course, this can be placed in a function or class on the page.
Some of the benefits of this approach are as follows:
- No query lines are displayed except for an unrelated identifier.
- This is pretty easy to implement in existing code.
Some of the disadvantages are as follows:
- A long session can accumulate many of these request objects.
- The unique identifier must be “truly unique” for this session.
Can anyone think of other advantages / disadvantages or a better way to do this (other than rewriting the application)?
Edit -
Thanks to everyone who says use HTTPS and POST. Unfortunately, I am looking for answers that are related to using only GET. (If you cannot explain how to send data to popups without using QueryString, Session, or Javascript?)