Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
clickjacket
Advanced tools
"Best-for-now" iframe protection to only allow iframes for any given protocols and/or domains. Replaces page html when viewed from an origin that is not allowed.
type: [String]
The domains to allow from an iframe. Allows all domains if not given.
type: [String]
The protocols to allow from an iframe. Allows all protocols if not given.
type: String
If an iframe fails to pass validation, this message replaces the page's html. Defaults to '';
<!-- Allow specific domains -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cool Site</title>
</head>
<body>
<script src="clickjacket.min.js"></script>
<script>
// Replaces the page html when viewed in an
// iframe not at the cooldomain.com or cooldomain.io domains.
(new ClickJacket({
allowedDomains: ['cooldomain.com', 'cooldomain.io']
})).runCheck();
</script>
</body>
</html>
<!-- Allow specific protocols -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cool Site</title>
</head>
<body>
<script src="clickjacket.min.js"></script>
<script>
// Replaces the page html when viewed in an
// iframe not using an https protocol.
(new ClickJacket({
allowedProtocols: ['https']
})).runCheck();
</script>
</body>
</html>
<!-- Show specialized message -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cool Site</title>
</head>
<body>
<script src="clickjacket.min.js"></script>
<script>
// Replaces the page html with a failure message.
(new ClickJacket({
allowedDomains: ['cooldomain.com', 'cooldomain.io'],
allowedProtocols: ['https'],
failureMessage: 'This site cannot be viewed from this iframe.'
})).runCheck();
</script>
</body>
</html>
FAQs
A simple JavaScript library for click-jacking protection.
We found that clickjacket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.