cross-origin-security
What it does
This skill checks how a site handles requests and messages that cross between origins. It is for developers who want to stop attackers from reading data or acting for users.
When to use it
- ✓When a site listens for messages from other windows or iframes.
- ✓When CORS settings allow any origin on logged-in routes.
- ✓When redirect parameters can send users to any outside address.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/cross-origin-security/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Check my site's message listeners and CORS settings for anything that could let other sites read user data.”
5 new skills a week. 1 minute to read.
How it works
The agent checks that message listeners verify where each message comes from, that CORS is limited on authenticated routes, and that redirects only go to approved destinations.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Handle cross-origin requests securely
The Same-Origin Policy is the browser's primary defense against malicious sites stealing data or performing actions on behalf of your users. Misconfiguring CORS or failing to validate postMessage origins can allow attackers to bypass this protection — reading private data, submitting forms as users, or injecting content into your pages.
Quick Reference
- Always verify event.origin before processing postMessage data
- Never set Access-Control-Allow-Origin: * for authenticated endpoints
- Validate and sanitize all data received from cross-origin messages
- Use SameSite cookies to prevent CSRF from cross-origin requests
- Reject unvalidated redirect targets such as
next,redirect, orcallbackUrl
Check
Check this code for insecure cross-origin patterns: missing origin validation in postMessage listeners, overly permissive CORS settings, and missing CSRF protections. Flag redirect parameters that accept arbitrary external URLs.
Fix
Add origin validation to postMessage listeners and review CORS configuration to ensure it's not overly permissive for authenticated routes. Reject or allow-list untrusted redirect destinations before navigating.
Explain
Explain the Same-Origin Policy, how CORS works, and how to securely use postMessage for cross-origin communication.
Code Review
Review scripts, client components, and browser execution paths related to Handle cross-origin requests securely. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser. Check login, logout, SSO, and return-to flows for open redirects.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/cross-origin-security
FAQ
What is the Same-Origin Policy?
The skill describes it as the browser's main defense against malicious sites reading or acting on user data.
What does the agent check in messages?
That the message origin is verified before any data is used.
Why are redirect parameters risky?
The skill says they can send users to arbitrary outside sites unless they are checked or approved.
Details
Original description by the author
Use when reviewing scripts, client components, bundles, or runtime behavior related to Handle cross-origin requests securely. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2793
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.