What it is: Unintended Proxy or Intermediary ('Confused Deputy') (CWE-441) is a security flaw where an application forwards requests without preserving the original source identity, making it appear as if the application itself initiated the request.
Why it matters: This vulnerability can lead to unauthorized access and privilege escalation by allowing attackers to masquerade as trusted entities.
How to fix it: Implement strong mutual authentication mechanisms between components to preserve the identity of the original requestor.
TL;DR: Unintended Proxy or Intermediary (‘Confused Deputy’) (CWE-441) is a security flaw where an application forwards requests without preserving the original source identity, making it appear as if the application itself initiated the request. Implement strong mutual authentication to prevent this vulnerability.
| Field | Value |
|---|---|
| CWE ID | CWE-441 |
| OWASP Category | A01:2025 - Broken Access Control |
| CAPEC | 219, 465 |
| Typical Severity | Critical |
| Affected Technologies | web applications, network protocols |
| Detection Difficulty | Moderate |
| Last Updated | 2026-07-29 |
What is Unintended Proxy or Intermediary (‘Confused Deputy’)?
Unintended Proxy or Intermediary (‘Confused Deputy’) (CWE-441) is a type of security vulnerability that occurs when an application forwards requests from an upstream component to an external actor without preserving the original source identity. This causes the product to appear as if it initiated the request, leading to unauthorized access and privilege escalation.
As defined by the MITRE Corporation under CWE-441, and classified by the OWASP Foundation under A01:2025 - Broken Access Control…
Quick Summary
Unintended Proxy or Intermediary (‘Confused Deputy’) is a security flaw where an application forwards requests without preserving the original source identity. This can lead to unauthorized access and privilege escalation, as attackers can masquerade as trusted entities.
Jump to: Quick Summary · Unintended Proxy or Intermediary (‘Confused Deputy’) Overview · How Unintended Proxy or Intermediary (‘Confused Deputy’) Works · Business Impact of Unintended Proxy or Intermediary (‘Confused Deputy’) · Unintended Proxy or Intermediary (‘Confused Deputy’) Attack Scenario · How to Detect Unintended Proxy or Intermediary (‘Confused Deputy’) · How to Fix Unintended Proxy or Intermediary (‘Confused Deputy’) · Framework-Specific Fixes for Unintended Proxy or Intermediary (‘Confused Deputy’) · How to Ask AI to Check Your Code for Unintended Proxy or Intermediary (‘Confused Deputy’) · Unintended Proxy or Intermediary (‘Confused Deputy’) Best Practices Checklist · Unintended Proxy or Intermediary (‘Confused Deputy’) FAQ · Vulnerabilities Related to Unintended Proxy or Intermediary (‘Confused Deputy’) · References · Scan Your Own Site
Unintended Proxy or Intermediary (‘Confused Deputy’) Overview
What
Unintended Proxy or Intermediary (‘Confused Deputy’) is a security flaw where an application forwards requests without preserving the original source identity.
Why it matters
This vulnerability can lead to unauthorized access and privilege escalation, as attackers can masquerade as trusted entities.
Where it occurs
In web applications and network protocols that forward external requests without proper verification of the original requestor’s identity.
Who is affected
Web services and applications that act as intermediaries between upstream components and external actors.
Who is NOT affected
Applications that maintain strict access control policies and do not act as proxies or intermediaries for transactions.
How Unintended Proxy or Intermediary (‘Confused Deputy’) Works
Root Cause
The application forwards requests from an upstream component to an external actor without preserving the original source identity, leading to unauthorized access.
Attack Flow
- Attacker sends a request through an intermediary.
- The intermediary forwards the request without verifying the original source identity.
- The target system receives the request as if it came directly from the intermediary.
Prerequisites to Exploit
- The application must forward requests without preserving the original source identity.
- The attacker needs access to send requests through the intermediary.
Vulnerable Code
def forward_request(request):
# Forward the request to an external actor without verifying the original source identity
target_system.send(request)
This code forwards a request directly to an external system without preserving the original source identity, making it vulnerable to Unintended Proxy or Intermediary (‘Confused Deputy’) attacks.
Secure Code
def forward_request(request):
# Verify and preserve the original source identity before forwarding the request
if verify_source_identity(request):
target_system.send(request)
This code ensures that the original source identity is verified and preserved before forwarding the request, mitigating the risk of Unintended Proxy or Intermediary (‘Confused Deputy’) attacks.
Business Impact of Unintended Proxy or Intermediary (‘Confused Deputy’)
Confidentiality
Data access can be compromised if attackers masquerade as trusted entities to gain unauthorized access.
Integrity
Modification of data may occur if attackers exploit the intermediary role to modify transactions.
Availability
Disruption of services is possible if attackers leverage the intermediary’s role to disrupt normal operations.
- Financial losses due to unauthorized transactions.
- Compliance violations from security breaches.
- Damage to reputation and trust with customers.
Unintended Proxy or Intermediary (‘Confused Deputy’) Attack Scenario
- Attacker sends a request through an intermediary application.
- The intermediary forwards the request without verifying the original source identity.
- The target system receives the request as if it came directly from the intermediary, allowing unauthorized access.
How to Detect Unintended Proxy or Intermediary (‘Confused Deputy’)
Manual Testing
- Review code paths where external requests are forwarded.
- Ensure that the identity of the original requestor is preserved throughout the transaction flow.
Automated Scanners (SAST / DAST)
Static analysis can detect patterns where source identities are not verified before forwarding requests. Dynamic testing confirms if such patterns lead to actual vulnerabilities in runtime scenarios.
PenScan Detection
PenScan’s automated scanners, including ZAP and Wapiti, actively test for this vulnerability by analyzing request flows and verifying identity preservation mechanisms.
False Positive Guidance
False positives may occur when the code appears risky but is actually safe due to context a scanner cannot detect. Review manually to confirm if the source identity verification mechanism is correctly implemented.
How to Fix Unintended Proxy or Intermediary (‘Confused Deputy’)
- Enforce strong mutual authentication mechanisms between components.
- Maintain the immutability of the source identity in transactions.
- Implement proper access control policies to prevent unauthorized forwarding of requests.
Framework-Specific Fixes for Unintended Proxy or Intermediary (‘Confused Deputy’)
Python/Django
def forward_request(request):
if verify_source_identity(request.META['REMOTE_ADDR']):
target_system.send(request)
This code verifies the source identity based on the remote address before forwarding the request, ensuring that only trusted entities can initiate requests.
How to Ask AI to Check Your Code for Unintended Proxy or Intermediary (‘Confused Deputy’)
Review the following Python code block for potential CWE-441 Unintended Proxy or Intermediary (‘Confused Deputy’) vulnerabilities and rewrite it using mutual authentication checks:
Review the following Python code block for potential CWE-441 Unintended Proxy or Intermediary ('Confused Deputy') vulnerabilities and rewrite it using mutual authentication checks: [paste code here]
Unintended Proxy or Intermediary (‘Confused Deputy’) Best Practices Checklist
✅ Enforce strong mutual authentication mechanisms between components. ✅ Verify the identity of requestors before forwarding requests. ✅ Ensure that transaction identities remain immutable throughout the process.
Unintended Proxy or Intermediary (‘Confused Deputy’) FAQ
How does the Unintended Proxy or Intermediary (‘Confused Deputy’) vulnerability work?
The application forwards requests from an upstream component to an external actor without preserving the original source, making it appear as if the application itself is initiating the request.
What are some real-world consequences of a Confused Deputy attack?
A successful attack can lead to unauthorized access, privilege escalation, and hiding malicious activities by leveraging the intermediary role of the compromised system.
Can you provide an example of vulnerable code for Unintended Proxy or Intermediary (‘Confused Deputy’)?
An example is a web service that forwards requests without verifying the original source identity before forwarding them to another server, allowing attackers to masquerade as trusted entities.
How can developers detect Unintended Proxy or Intermediary (‘Confused Deputy’) in their codebase?
Developers should review code paths where external requests are forwarded and ensure that the identity of the original requestor is preserved throughout the transaction flow.
What steps can organizations take to prevent Unintended Proxy or Intermediary (‘Confused Deputy’) attacks?
Implement strong mutual authentication mechanisms between components, maintain the immutability of the source identity in transactions, and enforce proper access control policies.
How do PenScan’s automated scanners detect Unintended Proxy or Intermediary (‘Confused Deputy’) vulnerabilities?
pattern: Review the following Python code block for potential CWE-441 Unintended Proxy or Intermediary (‘Confused Deputy’) vulnerabilities and rewrite it using mutual authentication checks:
What are some best practices to mitigate Unintended Proxy or Intermediary (‘Confused Deputy’) risks in web applications?
Use strong mutual authentication between components, verify the identity of requestors before forwarding requests, and ensure that transaction identities remain immutable throughout the process.
Vulnerabilities Related to Unintended Proxy or Intermediary (‘Confused Deputy’)
| CWE | Name | Relationship |
|---|---|---|
| CWE-610 | Externally Controlled Reference to a Resource in Another Sphere (ChildOf) | Child of CWE-441 |
| CWE-668 | Exposure of Resource to Wrong Sphere (CanPrecede) | Can precede CWE-441 |
References
Scan Your Own Site
Manual code review catches what you know to look for. An automated scan catches what you didn’t. Scan your own website using PenScan to find Unintended Proxy or Intermediary (‘Confused Deputy’) and other risks before an attacker does.