CWE-250: Execution with Unnecessary Privileges
Also known as: Excessive Agency
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.
Last updated
Overview
CWE-250 (Execution with Unnecessary Privileges) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
366 recorded CVEs are caused by CWE-250 (Execution with Unnecessary Privileges), including 1 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 110 new CWE-250 CVEs have been recorded so far in 2026 (101 in 2025).
- CVE-2025-40602CISA KEVHigh · CVSS 8.7 · EPSS 86th2025-12-18
- CVE-2026-65162Critical · CVSS 10.0 · EPSS 52th2026-10-13
- CVE-2026-4606
GeoVision ERM Improper Privilege Assignment Leads to SYSTEM-Level Privilege
Critical · CVSS 10.0 · EPSS 21th2026-03-23 - CVE-2025-32445
Users can gain privileged access to the host system and cluster with EventSource and Sensor CR
Critical · CVSS 10.0 · EPSS 57th2025-04-15 - CVE-2022-2634
Digi ConnectPort X2D
Critical · CVSS 10.0 · EPSS 64th2022-08-09 - CVE-2022-1517
3.2.1 EXECUTION WITH UNNECESSARY PRIVILEGES CWE-250
Critical · CVSS 10.0 · EPSS 79th2022-06-24 - CVE-2026-70496
Search-v2-operator: search-v2-operator: operator clusterrole is cluster-admin equivalent via impersonate, rbac write, csr approve, and manifestwork
Critical · CVSS 9.9 · EPSS 46th2026-08-19 - CVE-2026-72508
Multicloud-operators-subscription: multicloud-operators-subscription: hub and spoke serviceaccounts bound to wildcard rbac (*/*/*)
Critical · CVSS 9.9 · EPSS 57th2026-08-12 - CVE-2026-48584
Microsoft Azure Synapse Elevation of Privilege Vulnerability
Critical · CVSS 9.9 · EPSS 60th2026-06-19 - CVE-2026-25212Critical · CVSS 9.9 · EPSS 23th2026-04-02
- CVE-2024-8767Critical · CVSS 9.9 · EPSS 41th2024-09-17
- CVE-2024-3330
Spotfire Remote Code Execution Vulnerability
Critical · CVSS 9.9 · EPSS 48th2024-06-27
Showing 12 of 366 recorded CWE-250 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-250 is exploited.
Gain Privileges or Assume Identity, Execute Unauthorized Code or Commands, Read Application Data, DoS: Crash, Exit, or Restart
Affects: Confidentiality, Integrity, Availability, Access Control
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.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Technologies
How to prevent it
Practical mitigations for CWE-250, grouped by where in the lifecycle they apply.
Run your code using the lowest privileges that are required to accomplish the necessary tasks [3]. 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.
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 [3]. 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.
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 [3]. 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.
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.
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.
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 [3]. 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.
Ensure that the software runs properly under the United States Government Configuration Baseline (USGCB) [5] or an equivalent hardening configuration guide, which many organizations use to limit the attack surface and potential risk of deployed software.
How to detect it
Manual Analysis
This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.
Black Box
Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic.
Attach the monitor to the process and perform a login. Look for library functions and system calls that indicate when privileges are being raised or dropped. Look for accesses of resources that are restricted to normal users.
Automated Static Analysis - Binary or Bytecode
According to SOAR [8], the following detection techniques may be useful:
Highly cost effective:
Cost effective for partial coverage:
- Compare binary / bytecode to application permission manifest
- Bytecode Weakness Analysis - including disassembler + source code weakness analysis
- Binary Weakness Analysis - including disassembler + source code weakness analysis
Effectiveness: High
Manual Static Analysis - Binary or Bytecode
According to SOAR [8], the following detection techniques may be useful:
Cost effective for partial coverage:
- Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies
Effectiveness: SOAR Partial
Dynamic Analysis with Automated Results Interpretation
According to SOAR [8], the following detection techniques may be useful:
Cost effective for partial coverage:
- Host-based Vulnerability Scanners - Examine configuration for flaws, verifying that audit mechanisms work, ensure host configuration meets certain predefined criteria
Effectiveness: SOAR Partial
Dynamic Analysis with Manual Results Interpretation
According to SOAR [8], the following detection techniques may be useful:
Cost effective for partial coverage:
- Host Application Interface Scanner
Effectiveness: SOAR Partial
Manual Static Analysis - Source Code
According to SOAR [8], the following detection techniques may be useful:
Highly cost effective:
Cost effective for partial coverage:
- Manual Source Code Review (not inspections)
- Focused Manual Spotcheck - Focused manual analysis of source
Effectiveness: High
Automated Static Analysis - Source Code
According to SOAR [8], the following detection techniques may be useful:
Cost effective for partial coverage:
- Source code Weakness Analyzer
- Context-configured Source Code Weakness Analyzer
Effectiveness: SOAR Partial
Automated Static Analysis
According to SOAR [8], the following detection techniques may be useful:
Cost effective for partial coverage:
- Configuration Checker
- Permission Manifest Analysis
Effectiveness: SOAR Partial
Architecture or Design Review
According to SOAR [8], the following detection techniques may be useful:
Highly cost effective:
Cost effective for partial coverage:
- Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
- Formal Methods / Correct-By-Construction
- Attack Modeling
Effectiveness: High
Code examples
MITRE examples of the weakness in code.
This code temporarily raises the program's privileges to allow creation of a new user folder.
Vulnerable example
def makeNewUserDir(username):
if invalidUsername(username):
#avoid CWE-22 and CWE-78
raisePrivileges()
print('Unable to create new user directory for user:' + username)While the program only raises its privilege level to create the folder and immediately lowers it again, if the call to os.mkdir() throws an exception, the call to lowerPrivileges() will not occur. As a result, the program is indefinitely operating in a raised privilege state, possibly allowing further exploitation to occur.
The following code calls chroot() to restrict the application to a subset of the filesystem below APP_HOME in order to prevent an attacker from using the program to gain unauthorized access to files located elsewhere. The code then opens a file specified by the user and processes the contents of the file.
Constraining the process inside the application's home directory before opening any files is a valuable security measure. However, the absence of a call to setuid() with some non-zero value means the application is continuing to operate with unnecessary root privileges. Any successful exploit carried out by an attacker against the application can now result in a privilege escalation attack because any malicious operations will be performed with the privileges of the superuser. If the application drops to the privilege level of a non-root user, the potential for damage is substantially reduced.
This application intends to use a user's location to determine the timezone the user is in:
This is unnecessary use of the location API, as this information is already available using the Android Time API. Always be sure there is not another way to obtain needed information before resorting to using the location API.
This code uses location to determine the user's current US State location.
Vulnerable example
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2007-4217 — FTP client program on a certain OS runs with setuid privileges and has a buffer overflow. Most clients do not need extra privileges, so an overflow is not a vulnerability for those clients.
- CVE-2008-1877 — Program runs with privileges and calls another program with the same privileges, which allows read of arbitrary files.
- CVE-2007-5159 — OS incorrectly installs a program with setuid privileges, allowing users to gain privileges.
- CVE-2008-4638 — Composite: application running with high privileges (CWE-250) allows user to specify a restricted file to process, which generates a parsing error that leaks the contents of the file (CWE-209).
- CVE-2008-0162 — Program does not drop privileges before calling another program, allowing code execution.
- CVE-2008-0368 — setuid root program allows creation of arbitrary files through command line argument.
- CVE-2007-3931 — Installation script installs some programs as setuid when they shouldn't be.
- CVE-2020-3812 — mail program runs as root but does not drop its privileges before attempting to access a file. Attacker can use a symlink from their home directory to a directory only readable by root, then determine whether the file exists based on the response.
- CVE-2003-0908 — Product launches Help functionality while running with raised privileges, allowing command execution using Windows message to access "open file" dialog.
Terminology & mappings
Alternate terms
- 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.
Mapped taxonomies
- 7 Pernicious Kingdoms: Often Misused: Privilege Management
- The CERT Oracle Secure Coding Standard for Java (2011): Minimize privileges before deserializing from a privilege context (SER09-J)
- ISA/IEC 62443: Req SP.03.05 BR (Part 2-4)
- ISA/IEC 62443: Req SP.03.08 BR (Part 2-4)
- ISA/IEC 62443: Req SP.03.08 RE(1) (Part 2-4)
- ISA/IEC 62443: Req SP.05.07 BR (Part 2-4)
- ISA/IEC 62443: Req SP.09.02 RE(4) (Part 2-4)
- ISA/IEC 62443: Req SP.09.03 BR (Part 2-4)
- ISA/IEC 62443: Req SP.09.04 BR (Part 2-4)
- ISA/IEC 62443: Req SR 1.1 (Part 3-3)
- ISA/IEC 62443: Req SR 1.2 (Part 3-3)
- ISA/IEC 62443: Req SR 2.1 (Part 3-3)
- ISA/IEC 62443: Req SR 2.1 RE 1 (Part 3-3)
- ISA/IEC 62443: Req SD-4 (Part 4-1)
- ISA/IEC 62443: Req CCSC 3 (Part 4-2)
- ISA/IEC 62443: Req CR 1.1 (Part 4-2)
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-250.
- What is CWE-250?
- 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.
- What CVEs are caused by CWE-250?
- 366 recorded CVEs are attributed to CWE-250, including CVE-2025-40602, CVE-2026-65162 and CVE-2026-4606. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-250?
- Run your code using the lowest privileges that are required to accomplish the necessary tasks. 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.
- How is CWE-250 detected?
- Manual Analysis: This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.
- What are the consequences of CWE-250?
- Exploiting CWE-250 can lead to: Gain Privileges or Assume Identity, Execute Unauthorized Code or Commands, Read Application Data, DoS: Crash, Exit, or Restart.
- Is CWE-250 actively exploited?
- Yes. 1 CWE-250 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 366 recorded CVEs.
Sources
- [1]Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors (2005)
- [2]The Protection of Information in Computer Systems (1975)
- [3]Least Privilege (2005)
- [4]Writing Secure Code (2002)
- [5]United States Government Configuration Baseline (USGCB)
- [6]24 Deadly Sins of Software Security (2010)
- [7]The Art of Software Security Assessment (2006)
- [8]State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation (2014)
- [9]LLM06:2025 Excessive Agency
- [10]AML.T0053: AI Agent Tool Invocation (2023)
References
- MITRE CWE definition (CWE-250) (opens in a new tab)
- CWE-250 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-250 CVEs
Get an alert when a new CWE-250 CVE affects your products, with AI-written analysis and remediation steps.