Ethical Hacking Automation

Automate Recon and scanning process with Vidoc. All security teams in one place

postMessage - Cross-Site Scripting

By kannthu

Vidoc logoVidoc Module

What is "postMessage - Cross-Site Scripting?"

The "postMessage - Cross-Site Scripting" module is designed to detect cross-site scripting vulnerabilities in the postMessage function. This module targets software that utilizes the postMessage function for inter-window communication. Cross-site scripting vulnerabilities can allow attackers to execute arbitrary scripts, potentially leading to the theft of authentication credentials and other sensitive information. The severity of this vulnerability is classified as high.

This module was authored by pdteam.


A successful exploitation of the cross-site scripting vulnerability in the postMessage function can have serious consequences. Attackers can execute malicious scripts within the affected software, potentially compromising user data, session cookies, and launching other attacks.

How the module works?

The "postMessage - Cross-Site Scripting" module works by analyzing the source code of the target software and searching for specific patterns that indicate the presence of a cross-site scripting vulnerability in the postMessage function. It uses regular expressions to match the patterns and identify potential vulnerabilities.

For example, one of the matching conditions used by this module is the presence of the following code:


This condition checks if the postMessage function is called with any parameter, indicating a potential vulnerability.

When the module detects a match, it triggers the specified action, which in this case is to report the vulnerability.

It's important to note that this module does not perform any actual HTTP requests. Instead, it focuses on analyzing the source code and identifying potential vulnerabilities based on predefined matching conditions.

Module preview

Concurrent Requests (0)
Passive global matcher
regex: postMessage\([a-zA-Z]+,["']\*["']\)
On match action
Report vulnerability