CAPEC-468 Generic Cross-Browser Cross-Domain Theft

CAPEC ID: 468

CAPEC-468 Metadata

Likelihood of Attack

High

Typical Severity

Medium

Overview

Summary

An attacker makes use of Cascading Style Sheets (CSS) injection to steal data cross domain from the victim's browser. The attack works by abusing the standards relating to loading of CSS: 1. Send cookies on any load of CSS (including cross-domain) 2. When parsing returned CSS ignore all data that does not make sense before a valid CSS descriptor is found by the CSS parser.

Prerequisites

No new lines can be present in the injected CSS stringProper HTML or URL escaping of the " and ' characters is not presentThe attacker has control of two injection points: pre-string and post-string

Potential Solutions / Mitigations

Design: Prior to performing CSS parsing, require the CSS to start with well-formed CSS when it is a cross-domain load and the MIME type is broken. This is a browser level fix. Implementation: Perform proper HTML encoding and URL escaping

Related Weaknesses (CWE)

CWE ID Description
CWE-149 Improper Neutralization of Quoting Syntax
CWE-177 Improper Handling of URL Encoding (Hex Encoding)
CWE-707 Improper Neutralization
CWE-838 Inappropriate Encoding for Output Context

Related CAPECs

CAPEC ID Description
CAPEC-242 An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

Stay Ahead of Attack Patterns

Understanding CAPEC patterns helps security professionals anticipate and thwart potential attacks. Leverage these insights to enhance threat modeling, strengthen your software development lifecycle, and train your security teams effectively.