Reliance on Client-Side Security Controls

Security checks are carried out only in the browser, so anyone who sends requests directly to the server can bypass them.

SeverityMedium
CVSS 3.15.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N Open in the calculator
CVSS 4.05.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-602: Client-Side Enforcement of Server-Side Security
OWASP Top 10A06:2025 Insecure Design
MITRE ATT&CKT1190 Exploit Public-Facing Application
CategoryInput Validation

Description

The application relies on controls that run in the user's browser to enforce rules that matter for security: JavaScript validation of input, length limits set in the page, drop-down lists or radio buttons that restrict the values offered, fields that are disabled, hidden or marked read-only, buttons hidden for some roles, and decisions based on flags held in JavaScript variables, cookies or browser storage. The server accepts whatever it receives, on the assumption that the browser has already applied these rules.

Because every request can be intercepted, changed or written from scratch with an intercepting proxy, a command-line tool or a script, none of these controls binds an attacker, who usually needs only an ordinary account. They can submit data that the application never expected, bypass business rules and reach functions that the interface hides. Depending on what the server trusts, this can lead to invalid or malicious data being stored and later processed by other components, which may enable injection attacks there, to actions performed beyond a user's permitted limits, and to features or records being reached that the user should not see.

The weakness is identified by sending requests with values the interface prevents, such as out-of-range or over-length input, options that are not in a list, changed values in disabled or hidden fields and altered client-side flags, then checking whether the server accepts and acts on them. Specific forms of this weakness, such as trusting prices sent by the browser or binding unexpected properties onto data objects, are often reported separately where they have their own impact.

Remediation

Enforce every security-relevant rule on the server, and treat client-side checks as a convenience for users only:

  • Validate all input on the server for type, length, format and range, and check selections against an allowlist of the values that user may choose.
  • Make authorisation and feature decisions on the server for every request, using the identity and permissions in the server-side session, never flags supplied by the client.
  • Keep state that affects security on the server. Where a value must make a round trip through the client, protect it with a server-side signature, such as an HMAC, and verify it on return.
  • Where the same rules are needed in the browser and on the server, define them once, for example as a shared schema, and always enforce them on the server.
  • Ensure that features which are disabled or hidden in the interface are also disabled on the server.

Confirm the fix by sending requests directly with the values the interface prevents, and checking that the server rejects each one.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Web Applications Findings

Every Web Applications finding