Skip to main content
All CollectionsScan Findings
How does the Relative Path Confusion test (10051) work in HawkScan?
How does the Relative Path Confusion test (10051) work in HawkScan?

Interpreting Relative Path Confusion findings from HawkScan

Anthony Stinn avatar
Written by Anthony Stinn
Updated over 2 years ago

Question:

My scan results include Relative Path Confusion (ZAP plugin 10051) -- how should I investigate this finding?

Answer:

Alert Behavior

Relative Path Confusion is a ZAP plugin (10051) that HawkScan uses to test for relative path confusion as caused by "cross-content" responses (CWE-20).

Specifically, the tests for the ability to trick the browser into misinterpreting content types (such as interpreting HTML as CSS), as indicated by the presence or absence of particular headers and body elements in the response.

Note:

Resolving The Issue

Resolution Steps:

  1. Review Evidence and Other Info in the Scan Results to identify the specific issues

  2. Resolve the issue at the application level / Action the issue in the Platform

  3. Re-run a scan against the updated application -- does it still occur?

Explanation:

Below are the overall fix recommendations (from the zap page):

  • Header settings:

    • Use the 'Content-Type' HTTP response header to make it harder for the attacker to force the web browser to mis-interpret the content type of the response.

    • Use the 'X-Content-Type-Options: nosniff' HTTP response header to prevent the web browser from 'sniffing' the content type of the response.

    • Specify the 'X-Frame-Options' HTTP response header to prevent Quirks Mode from being enabled in the web browser using framing attacks.

  • DOCTYPE settings:

    • Use a modern DOCTYPE such as '<!doctype html>' to prevent the page from being rendered in the web browser using 'Quirks Mode', since this results in the content type being ignored by the web browser.

The alert tests for all of the above conditions, but how do you know which one(s) your application encountered?

By checking the following on the Scan Results page:

  • the Evidence pane

    • for instance, specific image links or .css files may be highlighted here

  • the Other Info tab

    • this section calls out specific findings in more detail

Example text from Other Info:

No <base> tag was specified in the HTML <head> tag to define the location for relative URLs. A Content Type of "text/html; charset=utf-8" was specified. If the web browser is employing strict parsing rules, this will prevent cross-content attacks from succeeding. Quirks Mode in the web browser would disable strict parsing. No X-Frame-Options header was specified, so the page can be framed, and this can be used to enable Quirks Mode, allowing the specified Content Type to be bypassed.

In the above scenario, the application was sending the correct Content-Type and X-Content-Type-Options headers, but the html body of the response revealed that no <base> tag was in use, opening up the use of Quirks Mode and the potential for an associated XSS vulnerability.

Additional Information

In some applications, setting the type attribute (fka, MIME type) of various html elements may resolve this alert.

Did this answer your question?