Katalog CWE

CWE-250 · Słabość

Execution with Unnecessary Privileges

Abstrakcja
Bazowa
Status
Szkic
Ryzyko wykorzystania
średnie
Dodano
19 lipca 2006
Ostatnia zmiana
30 kwietnia 2026

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

The product performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.

Inne nazwy

Excessive Agency
a term used by OWASP in its 2025 LLM Top Ten [REF-1524] that includes "excessive functionality" and "excessive permissions". This term might apply to multiple weaknesses.

Skutki

  • Confidentiality, Integrity, Availability, Access Control

    Gain Privileges or Assume Identity; Execute Unauthorized Code or Commands; Read Application Data; DoS: Crash, Exit, or Restart

    An attacker will be able to gain access to any resources that are allowed by the extra privileges. Common results include executing code, disabling services, and reading restricted data. New weaknesses can be exposed because running with extra privileges, such as root or Administrator, can disable the normal security checks being performed by the operating system or surrounding environment. Other pre-existing weaknesses can turn into security vulnerabilities if they occur while operating at raised privileges.

Zapobieganie

  • Architecture and Design, Operation · Environment Hardening

    Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.

  • Architecture and Design · Separation of Privilege

    Identify the functionality that requires additional privileges, such as access to privileged operating system resources. Wrap and centralize this functionality if possible, and isolate the privileged code as much as possible from other code [REF-76]. Raise privileges as late as possible, and drop them as soon as possible to avoid CWE-271. Avoid weaknesses such as CWE-288 and CWE-420 by protecting all possible communication channels that could interact with the privileged code, such as a secondary socket that is only intended to be accessed by administrators.

  • Architecture and Design · Attack Surface Reduction

    Identify the functionality that requires additional privileges, such as access to privileged operating system resources. Wrap and centralize this functionality if possible, and isolate the privileged code as much as possible from other code [REF-76]. Raise privileges as late as possible, and drop them as soon as possible to avoid CWE-271. Avoid weaknesses such as CWE-288 and CWE-420 by protecting all possible communication channels that could interact with the privileged code, such as a secondary socket that is only intended to be accessed by administrators.

  • Implementation

    Perform extensive input validation for any privileged code that must be exposed to the user and reject anything that does not fit your strict requirements.

  • Implementation

    When dropping privileges, ensure that they have been dropped successfully to avoid CWE-273. As protection mechanisms in the environment get stronger, privilege-dropping calls may fail even if it seems like they would always succeed.

  • Implementation

    If circumstances force you to run with extra privileges, then determine the minimum access level necessary. First identify the different permissions that the software and its users will need to perform their actions, such as file read and write permissions, network socket permissions, and so forth. Then explicitly allow those actions while denying all else [REF-76]. Perform extensive input validation and canonicalization to minimize the chances of introducing a separate vulnerability. This mitigation is much more prone to error than dropping the privileges in the first place.

  • Operation, System Configuration · Environment Hardening

    Ensure that the software runs properly under the United States Government Configuration Baseline (USGCB) [REF-199] or an equivalent hardening configuration guide, which many organizations use to limit the attack surface and potential risk of deployed software.

Przykłady podatności

Słabość nadrzędna

Kiedy powstaje

Dotyczy

Not Language-Specific, AI/ML, Mobile

Uwagi

There is a close association with CWE-653 (Insufficient Separation of Privileges). CWE-653 is about providing separate components for each privilege; CWE-250 is about ensuring that each component has the least amount of privileges possible.

CWE-271, CWE-272, and CWE-250 are all closely related and possibly overlapping. CWE-271 is probably better suited as a category. Both CWE-272 and CWE-250 are in active use by the community. The "least privilege" phrase has multiple interpretations.

Privilege management functions can behave in some less-than-obvious ways, and they have different quirks on different platforms. These inconsistencies are particularly pronounced if you are transitioning from one non-root user to another.

Signal handlers and spawned processes run at the privilege of the owning process, so if a process is running as root when a signal fires or a sub-process is executed, the signal handler or sub-process will operate with root privileges.

Źródła

  1. Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors — Katrina Tsipenyuk, Brian Chess, Gary McGraw, NIST, 2005
  2. The Protection of Information in Computer Systems — Jerome H. Saltzer, Michael D. Schroeder, Proceedings of the IEEE 63, 1975
  3. Least Privilege — Sean Barnum, Michael Gegick, 2005
  4. Writing Secure Code — Michael Howard, David LeBlanc, Chapter 7, "Running with Least Privilege" Page 207, Microsoft Press, 2002
  5. United States Government Configuration Baseline (USGCB) — NIST
  6. 24 Deadly Sins of Software Security — Michael Howard, David LeBlanc, John Viega, "Sin 16: Executing Code With Too Much Privilege." Page 243, McGraw-Hill, 2010
  7. The Art of Software Security Assessment — Mark Dowd, John McDonald, Justin Schuh, Chapter 9, "Privilege Vulnerabilities", Page 477, Addison Wesley, 2006
  8. State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation — Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler, Rama S. Moorthy, 2014
  9. LLM06:2025 Excessive Agency — OWASP
  10. AML.T0053: AI Agent Tool Invocation — MITRE ATLAS, 2023

Wpis z katalogu CWE 4.20.