| Impact | Details |
|---|---|
|
Modify Application Data; Execute Unauthorized Code or Commands |
Scope: Confidentiality, Integrity, Availability
Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.
|
|
Gain Privileges or Assume Identity |
Scope: Access Control
It is dangerous to use cookies to set a user's privileges. The cookie can be manipulated to escalate an attacker's privileges to an administrative level.
|
| Phase(s) | Mitigation |
|---|---|
|
Architecture and Design |
Avoid using cookie data for a security-related decision.
|
|
Implementation |
Perform thorough input validation (i.e.: server side validation) on the cookie data if you're going to use it for a security related decision.
|
|
Architecture and Design |
Add integrity checks to detect tampering.
|
|
Architecture and Design |
Protect critical cookies from replay attacks, since cross-site scripting or other attacks may allow attackers to steal a strongly-encrypted cookie that also passes integrity checks. This mitigation applies to cookies that should only be valid during a single transaction or session. By enforcing timeouts, you may limit the scope of an attack. As part of your integrity check, use an unpredictable, server-side value that is not exposed to the client.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 602 | Client-Side Enforcement of Server-Side Security |
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 642 | External Control of Critical State Data |
| ParentOf | Variant Variant - a weakness that is linked to a certain type of product, typically involving a specific language or technology. More specific than a Base weakness. Variant level weaknesses typically describe issues in terms of 3 to 5 of the following dimensions: behavior, property, technology, language, and resource. | 784 | Reliance on Cookies without Validation and Integrity Checking in a Security Decision |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | Category Category - a CWE entry that contains a set of other entries that share a common characteristic. | 1214 | Data Integrity Issues |
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 669 | Incorrect Resource Transfer Between Spheres |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | Category Category - a CWE entry that contains a set of other entries that share a common characteristic. | 1020 | Verify Message Integrity |
| Phase | Note |
|---|---|
| Architecture and Design | OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase. |
| Implementation |
Example 1
The following code excerpt reads a value from a browser cookie to determine the role of the user.
It is easy for an attacker to modify the "role" value found in the locally stored cookie, allowing privilege escalation.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference | Description |
|---|---|
|
e-dating application allows admin privileges by setting the admin cookie to 1.
|
| Method | Details |
|---|---|
|
Automated Static Analysis |
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 949 | SFP Secondary Cluster: Faulty Endpoint Authentication |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1354 | OWASP Top Ten 2021 Category A08:2021 - Software and Data Integrity Failures |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1403 | Comprehensive Categorization: Exposed Resource |
Rationale
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.Comments
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.Relationship
| Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
|---|---|---|---|
| Software Fault Patterns | SFP29 | Faulty endpoint authentication |
| Submissions | |||
|---|---|---|---|
| Submission Date | Submitter | Organization | |
|
2006年07月19日
(CWE Draft 3, 2006年07月19日) |
Anonymous Tool Vendor (under NDA) | ||
| Modifications | |||
| Modification Date | Modifier | Organization | |
|
2025年04月03日
(CWE 4.17, 2025年04月03日) |
CWE Content Team | MITRE | |
| updated Common_Consequences, Description, Diagram | |||
| 2023年10月26日 | CWE Content Team | MITRE | |
| updated Observed_Examples | |||
| 2023年06月29日 | CWE Content Team | MITRE | |
| updated Mapping_Notes | |||
| 2023年04月27日 | CWE Content Team | MITRE | |
| updated Detection_Factors, Relationships | |||
| 2023年01月31日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2021年10月28日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2020年02月24日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2019年06月20日 | CWE Content Team | MITRE | |
| updated Related_Attack_Patterns, Relationships | |||
| 2017年11月08日 | CWE Content Team | MITRE | |
| updated Modes_of_Introduction, Relationships | |||
| 2014年07月30日 | CWE Content Team | MITRE | |
| updated Relationships, Taxonomy_Mappings | |||
| 2012年05月11日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, Relationships | |||
| 2011年06月01日 | CWE Content Team | MITRE | |
| updated Common_Consequences | |||
| 2009年10月29日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2009年07月27日 | CWE Content Team | MITRE | |
| updated Description, Name, Potential_Mitigations, Relationship_Notes, Relationships, Taxonomy_Mappings | |||
| 2009年07月16日 | CWE Content Team | MITRE | |
| Clarified name and description; broadened the definition to include any security-critical operation, not just security decisions, to allow for relationships with injection weaknesses. | |||
| 2009年01月12日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Description, Other_Notes, Potential_Mitigations, Relationships | |||
| 2008年09月08日 | CWE Content Team | MITRE | |
| updated Relationships, Other_Notes, Taxonomy_Mappings | |||
| 2008年07月01日 | Eric Dalci | Cigital | |
| updated Potential_Mitigations, Time_of_Introduction | |||
| 2008年07月01日 | Sean Eidemiller | Cigital | |
| added/updated demonstrative examples | |||
| Previous Entry Names | |||
| Change Date | Previous Entry Name | ||
| 2008年04月11日 | Use of Cookies | ||
| 2009年07月27日 | Use of Cookies in Security Decision | ||
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.