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
312 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. 57 new CWE-250 CVEs have been recorded so far in 2026 (100 in 2025).
- CVE-2025-40602CISA KEVHigh · CVSS 8.7 · EPSS 77th2025-12-18
- CVE-2026-4606
GeoVision ERM Improper Privilege Assignment Leads to SYSTEM-Level Privilege
Critical · CVSS 10.0 · EPSS 22th2026-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 50th2025-04-15 - CVE-2022-2634Critical · CVSS 10.0 · EPSS 54th2022-08-09
- CVE-2022-1517Critical · CVSS 10.0 · EPSS 74th2022-06-24
- CVE-2026-48584
Microsoft Azure Synapse Elevation of Privilege Vulnerability
Critical · CVSS 9.9 · EPSS 39th2026-06-19 - CVE-2026-25212Critical · CVSS 9.9 · EPSS 21th2026-04-02
- CVE-2024-8767Critical · CVSS 9.9 · EPSS 38th2024-09-17
- CVE-2024-3330Critical · CVSS 9.9 · EPSS 44th2024-06-27
- CVE-2025-13375
IBM Common Cryptographic Architecture Arbitrary Command Execution
Critical · CVSS 9.8 · EPSS 40th2026-02-04 - CVE-2025-33223Critical · CVSS 9.8 · EPSS 44th2025-12-23
- CVE-2025-33224Critical · CVSS 9.8 · EPSS 50th2025-12-23
Showing 12 of 312 recorded CWE-250 CVEs. Track new ones as they are published and get AI-written analysis and fixes.
Monitor CWE-250 vulnerabilitiesCommon 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 [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.
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.
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.
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 [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.
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.
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 [REF-1479], the following detection techniques may be useful:
Effectiveness: High
Manual Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: SOAR Partial
Dynamic Analysis with Automated Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: SOAR Partial
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: SOAR Partial
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: High
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: SOAR Partial
Automated Static Analysis
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: SOAR Partial
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Effectiveness: High
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
This code temporarily raises the program's privileges to allow creation of a new user folder.
Vulnerable example
def makeNewUserDir(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.
Vulnerable example
chroot(APP_HOME);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:
Vulnerable example
locationClient = new LocationClient(this, this, this);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"/>Vulnerable example
locationClient = new LocationClient(this, this, this);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?
- 312 recorded CVEs are attributed to CWE-250, including CVE-2025-40602, CVE-2026-4606, CVE-2025-32445. 1 are 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 [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.
- 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 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 312 recorded CVEs.
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.
Stay ahead of CWE-250
Get alerted the moment a new CWE-250 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.