cve.bz

CAPEC-198

XSS Targeting Error Pages

Medium severityDetailed pattern

An adversary distributes a link (or possibly some other query structure) with a request to a third party web server that is malformed and also contains a block of exploit code in order to have the exploit become live code in the resulting error page.

On this page

When the third party web server receives the crafted request and notes the error it then creates an error message that echoes the malformed message, including the exploit. Doing this converts the exploit portion of the message into to valid language elements that are executed by the viewing browser. When a victim executes the query provided by the adversary the infected error message is returned including the exploit code which then runs in the victim's browser. XSS can result in execution of code as well as data leakage (e.g. session cookies can be sent to the attacker). This type of attack is especially dangerous since the exploit appears to come from the third party web server, who the victim may trust and hence be more vulnerable to deception.

Ask an AI about this attack pattern

Show the promptExplain the attack pattern CAPEC-198: XSS Targeting Error Pages: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/198.html and https://cve.bz/cve/capec/198?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.

How the attack unfolds

  1. Explore

    The attacker looks for a way in.

    1. [Survey the application for user-controllable inputs as URL parameters] Using a browser or an automated tool, an adversary follows all public links and actions on a web site. They record all the links, the forms, the resources accessed and all other potential entry-points for the web application, looking for URLs which use parameters.

      3 techniques
      • Use a spidering tool to follow and record all links and analyze the web pages to find entry points. Make 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.
      • Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery.
  2. Experiment

    They probe what they found.

    1. [Cause application to return error page] The adversary uses the URLs gathered in the "Explore" phase as a target list and injects various common script payloads and special characters into the parameters to see if an error page occurs, and if the injected payload is executed by the error page.

      3 techniques
      • Use a list of XSS probe strings to inject script in parameters of known URLs. If possible, the probe strings contain a unique identifier.
      • Use a proxy tool to record results of manual input of XSS probes in known URLs.
      • Use a list of HTML special characters to inject into parameters of known URLs and check if they caused errors
    2. [Craft malicious XSS URL] Once the adversary has determined which parameters are vulnerable to XSS through an error page, they will craft a malicious URL containing the XSS exploit. The adversary can have many goals, from stealing session IDs, cookies, credentials, and page content from the victim.

      2 techniques
      • Change a URL parameter to include a malicious script tag.
      • Send information gathered from the malicious script to a remote endpoint.
  3. Exploit

    They carry out the attack.

    1. [Get victim to click URL] In order for the attack to be successful, the victim needs to access the malicious URL.

      2 techniques
      • 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.

Prerequisites

  • A third party web server which fails to adequately sanitize messages sent in error pages.

  • The victim must be made to execute a query crafted by the adversary which results in the infected error report.

Resources required

  • None: No specialized resources are required to execute this type of attack.

Mitigations

  • Design: Use libraries and templates that minimize unfiltered input.

  • Implementation: Normalize, filter and use an allowlist for any input that will be used in error messages.

  • Implementation: The victim should configure the browser to minimize active content from untrusted sources.

Weaknesses it exploits

  • CWE-81 Improper Neutralization of Script in an Error Message Web Page

Recent CVEs with these weaknesses

  1. 6.1CVE-2026-41568

    Moby is an open source container framework. In Docker Engine prior to version 29.5.1, Docker Daemon versions 28.5.2 and prior, and Moby Daemon prior to version 2.0.0-beta.14, a race condition during docker cp mount setup allows a malicious…

  2. 6.3CVE-2025-24344

    A vulnerability in the error notification messages of the web application of ctrlX OS allows a remote unauthenticated attacker to inject arbitrary HTML tags and, possibly, execute arbitrary client-side code in the context of another user's…

  3. 2.1CVE-2025-0883

    Improper Neutralization of Script in an Error Message Web Page vulnerability in OpenText™ Service Manager.  The vulnerability could reveal sensitive information retained by the browser. This issue affects Service Manager: 9.70, 9.71, 9.7…

  4. 6.1CVE-2024-47882

    OpenRefine is a free, open source tool for working with messy data. Prior to version 3.8.3, the built-in "Something went wrong!" error page includes the exception message and exception traceback without escaping HTML tags, enabling injecti…

  5. 6.3CVE-2024-47064

    Computer Vision Annotation Tool (CVAT) is an interactive video and image annotation tool for computer vision. If an attacker can trick a logged-in CVAT user into visiting a maliciously-constructed URL, they can initiate any API calls on th…

  6. 6.1CVE-2024-6892

    Attackers can craft a malicious link that once clicked will execute arbitrary JavaScript in the context of the Journyx web application.

  7. 6.1CVE-2022-4137

    A reflected cross-site scripting (XSS) vulnerability was found in the 'oob' OAuth endpoint due to incorrect null-byte handling. This issue allows a malicious link to insert an arbitrary URI into a Keycloak error page. This flaw requires a …

  8. 6.1CVE-2022-4361

    Keycloak, an open-source identity and access management solution, has a cross-site scripting (XSS) vulnerability in the SAML or OIDC providers. The vulnerability can allow an attacker to execute malicious scripts by setting the AssertionCo…

The newest records naming one of them. Each weakness's page lists them all.

Part of

MITRE's words, unchanged: CAPEC-198 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.