Skip to main content

Hidden fields manipulation

Description

It is possible to modify fields that are invisible to the regular user and cause undesired behaviors in the application.

Impact

Force unwanted actions in the application modifying resources which can not be accessible by user.

Recommendation

Send only fields that require users inputs in the requests, and control the rest from the server.

Threat

Authenticated attacker from the Internet.

Expected Remediation Time

⌚ 60 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: A
  • Attack complexity: H
  • Privileges required: N
  • User interaction: R
  • Scope: U
  • Confidentiality: N
  • Integrity: L
  • Availability: N

Temporal

  • Exploit code madurity: X
  • Remediation level: X
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N/E:X/RL:X/RC:X
  • Score:
    • Base: 2.6
    • Temporal: 2.6
  • Severity:
    • Base: Low
    • Temporal: Low

Code Examples

Compliant code

Avoid using hidden input fields without handling them from the server side

<form action="/action_page.php">
<h1>Login Form</h1>
<div class="container">
<label for="uname"><strong>Username</strong></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><strong>Password</strong></label>
<input type="password" placeholder="Enter Password" name="psw" required>
</div>
<button type="submit">Login</button>
</form>

Non compliant code

There are hidden fields in the application forms that could be manipulated

<form action="/action_page.php">
<h1>Login Form</h1>
<div class="container">
<label for="uname"><strong>Username</strong></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><strong>Password</strong></label>
<input type="password" placeholder="Enter Password" name="psw" required>
// Using hidden fields
<input type="hidden" id="location" name="location" value="">
</div>
<button type="submit">Login</button>
</form>

Requirements

free trial

Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.