Client-Side Enforcement of Server-Side Security |
Weakness ID: 602 (Weakness Base) | Status: Draft |
Description Summary
Extended Description
When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms resulting in potentially unexpected interactions between the client and server. The consequences will vary, depending on what the mechanisms are trying to protect.
Scope | Effect |
---|---|
Integrity | Client-side validation checks can be easily bypassed, allowing malformed or unexpected input to pass into the application, potentially as trusted data. This may lead to unexpected states, behaviors and possibly a resulting crash. |
Access Control | Client-side checks for authentication can be easily bypassed, allowing clients to escalate their access levels and perform unintended actions. |
Consider a product that consists of two or more processes or nodes that must interact closely, such as a client/server model. If the product uses protection schemes in the client in order to defend from attacks against the server, and the server does not use the same schemes, then an attacker could modify the client in a way that bypasses those schemes. This is a fundamental design flaw that is primary to many weaknesses. |
Example 1
This example contains client-side code that checks if the user authenticated successfully before sending a command. The server-side code performs the authentication in one step, and executes the command in a separate step.
CLIENT-SIDE (client.pl)
SERVER-SIDE (server.pl):
The server accepts 2 commands, "AUTH" which authenticates the user, and "CHANGE-ADDRESS" which updates the address field for the username. The client performs the authentication and only sends a CHANGE-ADDRESS for that user if the authentication succeeds. Because the client has already performed the authentication, the server assumes that the username in the CHANGE-ADDRESS is the same as the authenticated user. An attacker could modify the client by removing the code that sends the "AUTH" command and simply executing the CHANGE-ADDRESS.
Reference | Description |
---|---|
CVE-2006-6994 | ASP program allows upload of .asp files by bypassing client-side checks. |
CVE-2007-0163 | steganography products embed password information in the carrier file, which can be extracted from a modified client. |
CVE-2007-0164 | steganography products embed password information in the carrier file, which can be extracted from a modified client. |
CVE-2007-0100 | client allows server to modify client's configuration and overwrite arbitrary files. |
Phase: Architecture and Design For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server. Even though client-side checks provide minimal benefits with respect to server-side security, they are still useful. First, they can support intrusion detection. If the server receives input that should have been rejected by the client, then it may be an indication of an attack. Second, client-side error-checking can provide helpful feedback to the user about the expectations for valid input. Third, there may be a reduction in server-side processing time for accidental input errors, although this is typically a small savings. |
Phase: Architecture and Design If some degree of trust is required between the two entities, then use integrity checking and strong authentication to ensure that the inputs are coming from a trusted source. Design the product so that this trust is managed in a centralized fashion, especially if there are complex or numerous communication channels, in order to reduce the risks that the implementer will mistakenly omit a check in a single code path. |
Phase: Testing Use dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results. |
Phase: Testing Use 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. These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules. |
Ordinality | Description |
---|---|
Primary | (where the weakness exists independent of other weaknesses) |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 254 | Security Features | Development Concepts (primary)699 |
ChildOf | ![]() | 669 | Incorrect Resource Transfer Between Spheres | Research Concepts (primary)1000 |
ChildOf | ![]() | 693 | Protection Mechanism Failure | Research Concepts1000 |
ChildOf | ![]() | 722 | OWASP Top Ten 2004 Category A1 - Unvalidated Input | Weaknesses in OWASP Top Ten (2004) (primary)711 |
ChildOf | ![]() | 753 | 2009 Top 25 - Porous Defenses | Weaknesses in the 2009 CWE/SANS Top 25 Most Dangerous Programming Errors (primary)750 |
CanPrecede | ![]() | 471 | Modification of Assumed-Immutable Data (MAID) | Research Concepts1000 |
PeerOf | ![]() | 290 | Authentication Bypass by Spoofing | Research Concepts1000 |
PeerOf | ![]() | 300 | Channel Accessible by Non-Endpoint ('Man-in-the-Middle') | Research Concepts1000 |
ParentOf | ![]() | 565 | Reliance on Cookies without Validation and Integrity Checking | Research Concepts1000 |
ParentOf | ![]() | 603 | Use of Client-Side Authentication | Research Concepts (primary)1000 |
Server-side enforcement of client-side security is conceptually likely to occur, but some architectures might have these strong dependencies as part of legitimate behavior, such as thin clients. |
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
OWASP Top Ten 2004 | A1 | CWE More Specific | Unvalidated Input |
CAPEC-ID | Attack Pattern Name | (CAPEC Version: 1.4) |
---|---|---|
21 | Exploitation of Session Variables, Resource IDs and other Trusted Credentials | |
31 | Accessing/Intercepting/Modifying HTTP Cookies | |
122 | Exploitation of Authorization | |
162 | Manipulating hidden fields to change the normal flow of transactions (eShoplifting) | |
202 | Create Malicious Client | |
207 | Removing Important Functionality from the Client | |
208 | Removing/short-circuiting 'Purse' logic: removing/mutating 'cash' decrements |
[REF-11] M. Howard and D. LeBlanc. "Writing Secure Code". Chapter 23, "Client-Side Security Is an Oxymoron" Page 687. 2nd Edition. Microsoft. 2002. |
Modifications | ||||
---|---|---|---|---|
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Relationships, Other Notes, Taxonomy Mappings, Weakness Ordinalities | ||||
2009-01-12 | CWE Content Team | MITRE | Internal | |
updated Demonstrative Examples, Description, Likelihood of Exploit, Name, Observed Examples, Other Notes, Potential Mitigations, Relationships, Research Gaps, Time of Introduction | ||||
2009-03-10 | CWE Content Team | MITRE | Internal | |
updated Potential Mitigations | ||||
2009-05-27 | CWE Content Team | MITRE | Internal | |
updated Demonstrative Examples | ||||
2009-07-27 | CWE Content Team | MITRE | Internal | |
updated Related Attack Patterns, Relationships | ||||
2009-10-29 | CWE Content Team | MITRE | Internal | |
updated Applicable Platforms, Common Consequences, Description | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-04-11 | Client-Side Enforcement of Server-Side Security | |||
2009-01-12 | Design Principle Violation: Client-Side Enforcement of Server-Side Security | |||