Confused deputy problem

In information security, the confused deputy problem is often cited as an example of why capability-based security is important. A confused deputy is a legitimate, more privileged computer program that is tricked by another program into misusing its authority on the system. It is a specific type of privilege escalation.[1]

Capability systems protect against the confused deputy problem, whereas access control list-based systems do not.[2]


In the original example of a confused deputy,[3] there is a program that provides compilation services to other programs. Normally, the client program specifies the name of the input and output files, and the server is given the same access to those files that the client has.

The compiler service is pay-per-use, and the compiler service stores its billing information in a file (dubbed BILL) that only it has access to.

In a situation where a client calls the service and names its output file BILL, the confused deputy problem occurs: the service opens the output file. Even though the client did not have access to that file, the service does, so the open succeeds. The server writes the compilation output to the file (here BILL) as normal, overwriting it, thus destroying the billing information.

The confused deputyEdit

In this example, the compilation service is the deputy because it is acting at the request of the client. The service is seen as 'confused' because it was tricked into overwriting its billing file.

Whenever a program tries to access a file, the operating system needs to know two things: which file the program is asking for, and whether the program has permission to access the file. In the example, the file is designated by its name, “BILL”. The server receives the file name from the client, but does not know whether the client had permission to write the file. When the server opens the file, the system uses the server's permission, not the client's. When the file name was passed from the client to the server, the permission did not go along with it; the permission was increased by the system silently and automatically.

It is not essential to the attack that the billing file be designated by a name represented as a string. The essential points are that:

  • the designator for the file does not carry the full authority needed to access the file;
  • the server's own permission to access the file is used implicitly.

Other examplesEdit

Prototypical confused deputy Barney Fife

A cross-site request forgery (CSRF) is an example of a confused deputy attack that uses the web browser to perform sensitive actions against a web application. A common form of this attack occurs when a web application uses a cookie to authenticate all requests transmitted by a browser. Using JavaScript, an attacker can force a browser into transmitting authenticated HTTP requests.

The Samy computer worm used cross-site scripting (XSS) to turn the browser's authenticated MySpace session into a confused deputy. Using XSS the worm forced the browser into posting an executable copy of the worm as a MySpace message which was then viewed and executed by friends of the infected user.

Clickjacking is an attack where the user acts as the confused deputy. In this attack a user thinks they are harmlessly browsing a website (an attacker-controlled website) but they are in fact tricked into performing sensitive actions on another website.[4]

An FTP bounce attack can allow an attacker to connect indirectly to TCP ports to which the attacker's machine has no access, using a remote FTP server as the confused deputy.

Another example relates to personal firewall software. It can restrict Internet access for specific applications. Some applications circumvent this by starting a browser with instructions to access a specific URL. The browser has authority to open a network connection, even though the application does not. Firewall software can attempt to address this by prompting the user in cases where one program starts another which then accesses the network. However, the user frequently does not have sufficient information to determine whether such an access is legitimate—false positives are common, and there is a substantial risk that even sophisticated users will become habituated to clicking "OK" to these prompts.[5]

Not every program that misuses authority is a confused deputy. Sometimes misuse of authority is simply a result of a program error. The confused deputy problem occurs when the designation of an object is passed from one program to another, and the associated permission changes unintentionally, without any explicit action by either party. It is insidious because neither party did anything explicit to change the authority.


In some systems it is possible to ask the operating system to open a file using the permissions of another client. This solution has some drawbacks:

  • It requires explicit attention to security by the server. A naive or careless server might not take this extra step.
  • It becomes more difficult to identify the correct permission if the server is in turn the client of another service and wants to pass along access to the file.
  • It requires the client to trust the server to not abuse the borrowed permissions. Note that intersecting the server and client's permissions does not solve the problem either, because the server may then have to be given very wide permissions (all of the time, rather than those needed for a given request) in order to act for arbitrary clients.

The simplest way to solve the confused deputy problem is to bundle together the designation of an object and the permission to access that object. This is exactly what a capability is.

Using capability security in the compiler example, the client would pass to the server a capability to the output file, such as a file descriptor, rather than the name of the file. Since it lacks a capability to the billing file, it cannot designate that file for output. In the cross-site request forgery example, a URL supplied "cross"-site would include its own authority independent of that of the client of the web browser.

See alsoEdit


  1. ^ Wu, Jianliang; Cui, Tingting; Ban, Tao; Guo, Shanqing; Cui, Lizhen (2015-09-10). "PaddyFrog: systematically detecting confused deputy vulnerability in Android applications: PaddyFrog: systematically detecting confused deputy vulnerability in Android applications". Security and Communication Networks. 8 (13): 2338–2349. doi:10.1002/sec.1179.
  2. ^ "ACLs don't".
  3. ^ "The Confused Deputy (or why capabilities might have been invented)". Archived from the original on 2003-12-05. Retrieved 2003-12-31.
  4. ^ "clickjacking: The Confused Deputy rides again!".
  5. ^ Alfred Spiessens: Patterns of Safe Collaboration, PhD thesis. Section 8.1.5

External linksEdit