Skip to content
vetkitChecksChangelogDocumentation

vetkit.js.postmessage.missing-origin-check

A window message event handler uses event.data without checking event.origin (or event.source). Any page that can open or frame this one can send it messages.

Last updated:

Suite: Security

javascript, typescript

A window message event handler uses event.data without checking event.origin (or event.source). Any page that can open or frame this one can send it messages.

Category: SECURITY · Engine rule severity: INFO

How to fix it

Return early unless event.origin is in an allow-list of expected origins before reading event.data.

References

Source: packages/engine/rules/sast/javascript.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.