Potential Cross Site Scripting (XSS)

Cross-Site Scripting (XSS) is a type of attack in which malicious scripts are injected into trusted websites. In XSS attacks, an attacker uses a benign web application to send malicious code, generally in the form of a browser-side script. This detection rule identifies the potential malicious executions of such browser-side scripts.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/07/12"
 3integration = ["apm"]
 4maturity = "deprecated"
 5updated_date = "2025/03/04"
 6deprecation_date = "2025/03/04"
 7
 8[rule]
 9author = ["Elastic"]
10building_block_type = "default"
11description = """
12Cross-Site Scripting (XSS) is a type of attack in which malicious scripts are injected into trusted websites. In XSS
13attacks, an attacker uses a benign web application to send malicious code, generally in the form of a browser-side
14script. This detection rule identifies the potential malicious executions of such browser-side scripts.
15"""
16from = "now-119m"
17index = ["apm-*-transaction*", "traces-apm*"]
18interval = "60m"
19language = "eql"
20license = "Elastic License v2"
21name = "Potential Cross Site Scripting (XSS)"
22references = ["https://github.com/payloadbox/xss-payload-list"]
23risk_score = 21
24rule_id = "4aa58ac6-4dc0-4d18-b713-f58bf8bd015c"
25severity = "low"
26tags = ["Data Source: APM", "Use Case: Threat Detection", "Tactic: Initial Access","Rule Type: BBR"]
27timestamp_override = "event.ingested"
28type = "eql"
29
30query = '''
31any where processor.name == "transaction" and
32url.fragment : ("<iframe*", "*prompt(*)*", "<script*>", "<svg*>", "*onerror=*", "*javascript*alert*", "*eval*(*)*", "*onclick=*",
33"*alert(document.cookie)*", "*alert(document.domain)*","*onresize=*","*onload=*","*onmouseover=*")
34'''
35
36
37[[rule.threat]]
38framework = "MITRE ATT&CK"
39[[rule.threat.technique]]
40id = "T1189"
41name = "Drive-by Compromise"
42reference = "https://attack.mitre.org/techniques/T1189/"
43
44
45[rule.threat.tactic]
46id = "TA0001"
47name = "Initial Access"
48reference = "https://attack.mitre.org/tactics/TA0001/"

References

Related rules

to-top