CAPEC-199
XSS Using Alternate Syntax
An adversary uses alternate forms of keywords or commands that result in the same action as the primary form but which may not be caught by filters. For example, many keywords are processed in a case insensitive manner. If the site's web filtering algorithm does not convert all tags into a consistent case before the comparison with forbidden keywords it is possible to bypass filters (e.g., incomplete black lists) by using an alternate case structure. For example, the "script" tag using the alternate forms of "Script" or "ScRiPt" may bypass filters where "script" is the only form tested. Other variants using different syntax representations are also possible as well as using pollution meta-characters or entities that are eventually ignored by the rendering engine. The attack can result in the execution of otherwise prohibited functionality.
Abstraction
Detailed
Typical severity
High
Likelihood of attack
High
Understand the attack
What is this attack pattern?
Execution flow
How does the attack proceed, step by step?
Explore
Survey the application for user-controllable inputs
Techniques used
- Use a spidering tool to follow and record all links. Make special note of any links that include parameters in the URL.
- Use a proxy tool to record all links visited during a manual traversal of the web application. Make special note of any links that include parameters in the URL. Manual traversal of this type is frequently necessary to identify forms that are GET method forms rather than POST forms.
- Use a browser to manually explore the website and analyze how it is constructed. Many browser's plugins are available to facilitate the analysis or automate the URL discovery.
Experiment
Probe identified potential entry points for XSS vulnerability
Techniques used
- Use a list of XSS probe strings to inject in parameters of known URLs. If possible, the probe strings contain a unique identifier. Attempt numerous variations based on form, format, syntax & encoding.
- Use a proxy tool to record results of manual input of XSS probes in known URLs.
Craft malicious XSS URL
Techniques used
- Change a URL parameter to include a malicious script tag created using alternate syntax to bypass filters.
- Send information gathered from the malicious script to a remote endpoint.
Exploit
Get victim to click URL
Techniques used
- Send a phishing email to the victim containing the malicious URL. This can be hidden in a hyperlink as to not show the full URL, which might draw suspicion.
- Put the malicious URL on a public forum, where many victims might accidentally click the link.
Requirements
What does the attack require?
Prerequisites
- Target client software must allow scripting such as JavaScript.
Skills required
- Low: To inject the malicious payload in a web page
- High: To bypass non trivial filters in the application
Resources required
- Ability to send HTTP request to a web application.
Impact
What does a successful attack lead to?
Affected scopes: Integrity
Affected scopes: Confidentiality
Affected scopes: Authorization
Affected scopes: Accountability, Authentication, Authorization, Non-Repudiation
Affected scopes: Access Control, Authorization
Defence
How is it prevented and mitigated?
Real world