Weakness · High
CWE-270: Privilege Context Switching Error
What it is
The product does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control.
- Severity (our rating)
- High
- Likelihood of exploit
- Not rated by MITRE
- Introduced during
- Architecture and Design, Implementation, Operation
- Exploited in the wild
- No CVE in CISA's catalog
What an attacker can do
- Gain Privileges or Assume Identity (Access Control)
How to prevent it
Architecture and Design
- Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
- 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.
- Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.
H2 Security
Found it in your code?
We review where it appears, fix it with your team, and check it was not already used against you.
Talk to our teamT Academy
Stop writing it in the first place
Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.
Start freeSource: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.