Using Referer Field for Authentication
The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.
The referer field in HTML requests can be simply modified by malicious users, rendering it useless as a means of checking the validity of the request in question.
The following examples help to illustrate the nature of this weakness and describe methods or techniques which can be used to mitigate the risk.
Note that the examples here are by no means exhaustive and any given weakness may have many subtle varieties, each of which may require different detection methods or runtime controls.
The following code samples check a packet's referer in order to decide whether or not an inbound request is from a trusted host.
These examples check if a request is from a trusted referer before responding to a request, but the code only verifies the referer name as stored in the request packet. An attacker can spoof the referer, thus impersonating a trusted client.
Weaknesses in this category are related to the design and architecture of authentication components of the system. Frequently these deal with verifying the entity is i...
This category identifies Software Fault Patterns (SFPs) within the Faulty Endpoint Authentication cluster (SFP29).
This view (slice) covers all the elements in CWE.
This view (slice) lists weaknesses that can be introduced during design.