Identity, Privileged access management

How the ‘Confused Deputy Problem’ has made a comeback

Cybersecurity Solutions for Privileged Access Management Safeguarding Identity Control Compliance Risk Management

COMMENTARY: In cybersecurity, sometimes the most significant threat isn't the external threat actor or the potential for an insider threat. It's a trusted and approved application like an administrative tool, a privileged process, or an automation script that gets manipulated into doing something it was never intended to do.

Think of this as the foundational definition for the “Confused Deputy Problem,” a classic privileged escalation vulnerability with very modern consequences, particularly in the realm of Agentic AI technology and least privilege enforcement.

[SC Media Perspectives columns are written by a trusted community of SC Media cybersecurity subject matter experts. Read more Perspectives here.]

The confused deputy problem arises when a program or application (the deputy) that has legitimate authority to access certain resources gets tricked into misusing its established privileges by another, less-privileged program, application, or user.

This vulnerability occurs when a deputy program lacks sufficient context or safeguards to distinguish between requests it should honor and those that it should reject based on behavior, context, or sensitivity including the data that a user may request.

In fairness, it’s not a new problem. The term comes from a 1988 paper by Norm Hardy, where a compiler (the deputy) was allowed to overwrite billing files because it trusted the file paths given to it by end user applications. These programs lacked the authority to access these files directly, but the compiler had the appropriate entitlements to do so and ultimately overwrote them on the end user’s behalf. In essence, the deputy had more power than the end user and was compromised into overwriting files based on inappropriate requests.

Today, when privileged escalation occurs between programs, it’s known as the confused deputy problem. In the world of Agentic AI, it’s now reborn and has been thriving. In fact, it still does appear in many cloud IAM misconfigurations, misused APIs, OAuth scopes, SuDo commands, and drives on as one of the primary use cases for embracing least privilege and an enterprise-wide PAM deployment for machine identities.

Privilege without perspective

Privileged accounts, whether human or machine, often act as deputies. They have access to sensitive systems, credentials, and data. But without robust enforcement of least privilege and context-aware decision-making, they can become blind executioners of malicious or unintended commands.

Consider a CI/CD automation script that runs under a privileged service account. If this script accepts parameters from a user and passes them without validation to a command that has elevated access, a lower-privileged user can exploit the script to escalate privilege.

This happens frequently, a service account becomes the confused deputy, executing harmful operations at the behest of someone with less privilege. And if we consider the potential power of Agentic AI, we realize it’s possible to build this least privilege problem into agents that we rely on every day for our business workflows.

The pattern emerges constantly in PAM environments that haven’t fully integrated least privilege principles and now developing new AI code to automate businesses. It’s not just about removing standing access, but ensuring that hackers can’t hijack or subvert privileged workflows based on the connections and entitlements they can establish.

Here are some common confused deputy scenarios:

  • SuDo misuse: An administrator grants a user the ability to run a script with SuDo (super user) privileges. That script, in turn, calls other commands or interprets parameters without sanitization. The attacker escalates privilege via the script, not by exploiting the OS directly, but by confusing the script into acting on its elevated authority. The common solution: use a PAM that focuses on endpoint privileged management (EPM) that can secure scripts even if they operate in the background and outside of a user’s content.
  • Password vaulting without behavioral analysis: PAM products often vault credentials and broker access. But if a system lets arbitrary commands run under a vaulted credential (via a jump host or automation engine), without auditing or context-checking, an attacker may misuse the vaulted session for lateral movement or exfiltration. Therefore, monitoring sessions and the commands being executed are a crucial part of preventing a confused deputy.
  • Shared service accounts: In CI/CD pipelines, shared service accounts often have persistent access to secrets, registries, or production APIs. If one developer gains indirect access to those credentials, they can coerce the deputy (the pipeline) into deploying malicious artifacts or leaking secrets. This is the use case for secrets management for automation and this attack vector has been the subject of multiple supply chain attacks over recent years.
  • Cloud IAM token abuse: In cloud environments, microservices often assume roles via STS. If one service tricks another into calling an API on its behalf, using its own assumed privileges, it becomes a confused deputy—a risk seen in misconfigured AWS Lambda or Azure Functions.
  • What to do about the new confused deputy problem

    Teams need to evolve PAM beyond secrets management  and session brokering. It must verify intent, enforce context, and enable granular just-in-time privileges for humans, machines, and application to application communications. Here’s how a Modern PAM system solves these problems:

    • Command filtering and validation: PAMs should enforce command whitelisting, restrict parameter injection, and validate user input to prevent elevation through indirect means.
    • Context-aware access decisions: Access policies must account for who initiated the session, under what conditions, and with what purpose. This includes not just whether a session has been allowed to start, but also includes behavioral and risk-based context that dictates what operations are allowed even mid-session.
    • Segregation of duties and role isolation: We should not let identities and accounts get used universally throughout an enterprise. Separate service and application accounts for automation, debugging, and deployment reduce the blast radius from any single confused deputy attack. Least privilege dictates that no account should have more access than necessary and having multiple accounts honoring least privilege is better than one account with a summation of all of their privileges.
    • Auditing and monitoring in real-time: If a privileged account gets misused, we need forensics and insights. PAMs must offer full session recording, keystroke logging, and command audit trails to catch abuse, whether deliberate or confused. In addition, having a strong identity security posture can help identify any abuse a deputy may perform on other resources when access becomes out of scope.
    • Dynamic credential injection: Avoid standing access by rotating credentials or injecting them at runtime through ephemeral secrets. If a user or process does not know the credential, it’s harder to misuse the deputy because all access requests are validated and logged first.
    • Think of the confused deputy problem as more than a technical footnote: with emerging Agentic AI, it's now a strategic challenge. It reminds us that power without discernment represents a vulnerability, and that least privilege is not just about access, it’s about intent, control, and mitigating potential abuse.

      When implemented thoughtfully, PAM should not merely manage who can access privileged accounts, but should defend against confused deputies at every layer: people, process, machines, and most importantly, applications and programs. With AI appearing everywhere and a part of every conversation, a team’s most trusted tool can become its most dangerous adversary. All it takes is the right level of confusion to make a good program behave badly.

      Morey Haber, chief security advisor, BeyondTrust

      SC Media Perspectives columns are written by a trusted community of SC Media cybersecurity subject matter experts. Each contribution has a goal of bringing a unique voice to important cybersecurity topics. Content strives to be of the highest quality, objective and non-commercial.

      An In-Depth Guide to Identity

      Get essential knowledge and practical strategies to fortify your identity security.
      Morey Haber

      As the Chief Security Advisor at BeyondTrust, Morey J. Haber is the lead identity and technical evangelist at the company. He has more than 25 years of IT industry experience and has authored four books: Privileged Attack Vectors, Asset Attack Vectors, Identity Attack Vectors, and Cloud Attack Vectors. Morey has previously served as BeyondTrust’s Chief Security Officer, Chief Technology Officer, and Vice President of Product Management during his 12-year tenure. In 2020, Morey was elected to the Identity Defined Security Alliance (IDSA) Executive Advisory Board, assisting the corporate community with identity security best practices.

      You can skip this ad in 5 seconds