At work we use a central portal that provides basic SSO functionality to other a
ID: 659887 • Letter: A
Question
At work we use a central portal that provides basic SSO functionality to other applications. In addition to verifying the SSO data sent, all of our existing in-house applications (used by the public) also check the referrer header to make sure that the user is actually coming from our central portal. However, we just experienced an issue where a JavaScript code change in the central portal caused Internet Explorer to stop forwarding the referrer header, which brought down all the apps that check that header.
My question is whether checking the referrer header provides any real world security improvement over just checking the basic SSO information (encrypted user ID contained in a cookie)? If it doesn't, is there any documentation/research/etc. that I could use to prove this to management?
I should also mention that unfortunately the central portal is a third party app which we don't have much control over ... so basic SSO information in the form of an encrypted cookie and referrer header information is all we have to help secure things.
Explanation / Answer
Short answer: no.
Long answer: it depends.
Referer is a header sent and controlled by the client. You cannot trust any data coming unchecked from the client. As others pointed out, it can be easily manipulated. It can contain anything the attacker wants, so don't rely on it.
If your URL contain any crypto token(http://site.com/x.php?op=1&token=-random-data-), it could be marginally useful. You would have to check the token with a session variable to determine if the header was not tampered.
But even with a token, referer checking will only work until a new browser/plugin/extension/proxy begins stripping Referer header for privacy reasons.
If possible, you can try to use the IP address of the client tied to browser fingerprinting headers (User-Agent, Accept, Accept-Language) to get more layers of security. Keeping those headers on a sesssion variable, you can detect if someone stole the credentials of your user, if someone is trying to bypass authentication, and other attacks.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.