---
title: "CWE-293: Using Referer Field for Authentication"
url: https://radicalnotion.ai/cwe/cwe-293
type: cwe
description: "The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-293: Using Referer Field for Authentication

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.

## Background

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.

## Alternate terms

- **referrer:** While the proper spelling might be regarded as "referrer," the HTTP RFCs and their implementations use "referer," so this is regarded as the correct spelling.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Gain Privileges or Assume Identity | Actions, which may not be authorized otherwise, can be carried out as if they were validated by the server referred to. |

## Potential mitigations

### Architecture and Design

In order to usefully check if a given action is authorized, some means of strong authentication and method protection must be used. Use other means of authorization that cannot be simply spoofed. Possibilities include a username/password or certificate.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Demonstrative examples

### Example 1

The following code samples check a packet's referer in order to decide whether or not an inbound request is from a trusted host.

Bad code:

```c++
String trustedReferer = "http://www.example.com/"
while(true){
    n = read(newsock, buffer, BUFSIZE);
    requestPacket = processPacket(buffer, n);
    if (requestPacket.referer == trustedReferer){
        openNewSecureSession(requestPacket);
    }
}
```

Bad code:

```java
boolean processConnectionRequest(HttpServletRequest request){
    String referer = request.getHeader("referer")
    String trustedReferer = "http://www.example.com/"
    if(referer.equals(trustedReferer)){
        openPrivilegedConnection(request);
        return true;
    }
    else{
        sendPrivilegeError(request);
        return false;
    }
}
```

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.

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-20025 | Cisco Small Business RV016, RV042, RV042G, RV082, RV320, and RV325 Routers Vulnerabilities | critical | 9.8 | - | No | 2023-01-19 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-290](https://radicalnotion.ai/cwe/cwe-290) | Authentication Bypass by Spoofing |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Using referrer field for authentication | - | - |
| Software Fault Patterns | Faulty endpoint authentication | SFP29 | - |

## Frequently asked questions

### What is CWE-293?

The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.

### What CVEs are caused by CWE-293?

1 recorded CVE is attributed to CWE-293: CVE-2023-20025.

### How do you prevent CWE-293?

In order to usefully check if a given action is authorized, some means of strong authentication and method protection must be used. Use other means of authorization that cannot be simply spoofed. Possibilities include a username/password or certificate.

### How is CWE-293 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-293?

Exploiting CWE-293 can lead to: Gain Privileges or Assume Identity.

### Is CWE-293 actively exploited?

1 recorded CVE is caused by CWE-293; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/293.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-293). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
