CWE-602 Class Draft Medium likelihood

Client-Side Enforcement of Server-Side Security

This vulnerability occurs when a server incorrectly trusts the client to enforce critical security rules, such as input validation or access controls, instead of performing these checks itself.

Definition

What is CWE-602?

This vulnerability occurs when a server incorrectly trusts the client to enforce critical security rules, such as input validation or access controls, instead of performing these checks itself.
This flaw creates a fundamental trust issue. Since an attacker has full control over their own client—whether it's a browser, mobile app, or API client—they can easily bypass, remove, or manipulate any client-side security checks. The server, operating under the false assumption that these checks are reliable, then processes malicious or unauthorized requests. The impact depends entirely on what the client was supposed to protect. Common consequences include unauthorized data access, privilege escalation, data corruption, or complete system compromise. The root cause is a design error: security must always be enforced at the point where trust is established and data is ultimately processed—the server.
Real-world impact

Real-world CVEs caused by CWE-602

  • SCADA system only uses client-side authentication, allowing adversaries to impersonate other users.

  • ASP program allows upload of .asp files by bypassing client-side checks.

  • steganography products embed password information in the carrier file, which can be extracted from a modified client.

  • steganography products embed password information in the carrier file, which can be extracted from a modified client.

  • client allows server to modify client's configuration and overwrite arbitrary files.

How attackers exploit it

Step-by-step attacker path

  1. 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.

  2. 2

    CLIENT-SIDE (client.pl)

  3. 3

    SERVER-SIDE (server.pl):

  4. 4

    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.

  5. 5

    In 2022, the OT:ICEFALL study examined products by 10 different Operational Technology (OT) vendors. The researchers reported 56 vulnerabilities and said that the products were "insecure by design" [REF-1283]. If exploited, these vulnerabilities often allowed adversaries to change how the products operated, ranging from denial of service to changing the code that the products executed. Since these products were often used in industries such as power, electrical, water, and others, there could even be safety implications.

Vulnerable code example

Vulnerable Perl

SERVER-SIDE (server.pl):

Vulnerable Perl
$sock = acceptSocket(1234);
  ($cmd, $args) = ParseClientRequest($sock);
  if ($cmd eq "AUTH") {
  		($username, $pass) = split(/\s+/, $args, 2);
  		$result = AuthenticateUser($username, $pass);
  		writeSocket($sock, "$result\n");
```
# does not close the socket on failure; assumes the* 
  		
  		
  		 *# user will try again* 
  		}
  elsif ($cmd eq "CHANGE-ADDRESS") {
  ```
  	if (validateAddress($args)) {
  		$res = UpdateDatabaseRecord($username, "address", $args);
  		writeSocket($sock, "SUCCESS\n");
  	}
  	else {
  		writeSocket($sock, "FAILURE -- address is malformed\n");
  	}
  }
Secure code example

Secure Perl

CLIENT-SIDE (client.pl)

Secure Perl
$server = "server.example.com";
  $username = AskForUserName();
  $password = AskForPassword();
  $address = AskForAddress();
  $sock = OpenSocket($server, 1234);
  writeSocket($sock, "AUTH $username $password\n");
  $resp = readSocket($sock);
  if ($resp eq "success") {
```
# username/pass is valid, go ahead and update the info!* 
  		writeSocket($sock, "CHANGE-ADDRESS $username $address\n";}
  else {
  ```
  	print "ERROR: Invalid Authentication!\n";
  }
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Prevention checklist

How to prevent CWE-602

  • 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.
  • 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.
  • 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.
  • 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.
Detection signals

How to detect CWE-602

SAST High

Run static analysis (SAST) on the codebase looking for the unsafe pattern in the data flow.

DAST Moderate

Run dynamic application security testing against the live endpoint.

Runtime Moderate

Watch runtime logs for unusual exception traces, malformed input, or authorization bypass attempts.

Code review Moderate

Code review: flag any new code that handles input from this surface without using the validated framework helpers.

Plexicus auto-fix

Plexicus auto-detects CWE-602 and opens a fix PR in under 60 seconds.

Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.

Frequently asked questions

Frequently asked questions

What is CWE-602?

This vulnerability occurs when a server incorrectly trusts the client to enforce critical security rules, such as input validation or access controls, instead of performing these checks itself.

How serious is CWE-602?

MITRE rates the likelihood of exploit as Medium — exploitation is realistic but typically requires specific conditions.

What languages or platforms are affected by CWE-602?

MITRE lists the following affected platforms: ICS/OT, Mobile.

How can I prevent CWE-602?

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…

How does Plexicus detect and fix CWE-602?

Plexicus's SAST engine matches the data-flow signature for CWE-602 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.

Where can I learn more about CWE-602?

MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/602.html. You can also reference OWASP and NIST documentation for adjacent guidance.

Related weaknesses

Weaknesses related to CWE-602

CWE-693 Parent

Protection Mechanism Failure

This weakness occurs when software either lacks a necessary security control, implements one that is too weak, or fails to activate an…

CWE-1039 Sibling

Inadequate Detection or Handling of Adversarial Input Perturbations in Automated Recognition Mechanism

This vulnerability occurs when a system uses automated AI or machine learning to classify complex inputs like images, audio, or text, but…

CWE-1248 Sibling

Semiconductor Defects in Hardware Logic with Security-Sensitive Implications

A security-critical hardware component contains physical flaws in its semiconductor material, which can cause it to malfunction and…

CWE-1253 Sibling

Incorrect Selection of Fuse Values

This vulnerability occurs when a hardware security fuse is incorrectly programmed to represent a 'secure' state as logic 0 (unblown). An…

CWE-1269 Sibling

Product Released in Non-Release Configuration

This vulnerability occurs when a product ships to customers while still configured with its pre-production or manufacturing settings,…

CWE-1278 Sibling

Missing Protection Against Hardware Reverse Engineering Using Integrated Circuit (IC) Imaging Techniques

This vulnerability occurs when hardware lacks safeguards against physical inspection, allowing attackers to extract sensitive data by…

CWE-1291 Sibling

Public Key Re-Use for Signing both Debug and Production Code

This vulnerability occurs when the same cryptographic key is used to sign both development/debug software builds and final production…

CWE-1318 Sibling

Missing Support for Security Features in On-chip Fabrics or Buses

This vulnerability occurs when the communication channels (fabrics or buses) within a chip lack built-in or enabled security features,…

CWE-1319 Sibling

Improper Protection against Electromagnetic Fault Injection (EM-FI)

This vulnerability occurs when a hardware device lacks sufficient shielding against electromagnetic interference, allowing attackers to…

Ready when you are

Don't Let Security
Weigh You Down.

Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.