
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
@canton-network/core-origin-manager
Advanced tools
Secure cross-window origin handshake and guarded postMessage helpers.
This package provides a secure cross-window communication mechanism for verifying the origin of messages in a browser environment. It implements a handshake protocol to validate and track allowed origins before permitting inter-window communication.
pnpm add @canton-network/core-origin-manager
The origin-check package provides origin validation for secure cross-window communication in browser applications. It uses a bidirectional handshake protocol to establish trust between parent and child windows before allowing message passing.
SPLICE_WALLET_BROADCAST_ORIGIN.SPLICE_WALLET_BROADCAST_ORIGIN_ACK via window.opener, then stops listening.sequenceDiagram
participant Parent as Parent window<br/>(ParentWindowOriginManager)
participant Child as Child popup<br/>(ChildWindowOriginManager)
Note over Parent,Child: Setup
Parent->>Parent: addEventListener("message")
Child->>Child: addEventListener("message")
Parent->>Parent: poll(childOrigin) every 500ms
Note over Parent,Child: Handshake
loop Until ACK received
Parent->>Child: postMessage({ message: SPLICE_WALLET_BROADCAST_ORIGIN, origin: parentOrigin }, childOrigin)
end
Child->>Child: Zod-parse + check event.origin matches payload.origin
Child->>Child: allowedOrigins.add(parentOrigin)
Child->>Parent: opener.postMessage({ message: SPLICE_WALLET_BROADCAST_ORIGIN_ACK, origin: childOrigin }, parentOrigin)
Child->>Child: removeListener()
Parent->>Parent: Zod-parse + check event.origin matches payload.origin
Parent->>Parent: allowedOrigins.add(childOrigin)
Parent->>Parent: clearInterval(poll)
Note over Parent,Child: After handshake
Parent->>Child: postMessage(appData, childOrigin)<br/>only if assert(childOrigin)
Child->>Parent: opener.postMessage(appData, parentOrigin)<br/>only if assert(parentOrigin)
A Zod-validated schema defining the structure of origin handshake messages. Contains:
message: The type of handshake message (SPLICE_WALLET_BROADCAST_ORIGIN or SPLICE_WALLET_BROADCAST_ORIGIN_ACK)origin: The origin string being communicatedAbstract base class that manages origin validation through a message-based handshake protocol. Provides:
window.message eventsassert(origin): Check if an origin is allowedpostMessage(message, origin): Send a message to an allowed origin (safely validates origin first)removeListener(): Clean up the message event listenerExtends OriginManager for use in parent windows. Features:
postMessage(message, origin): Send a message to the child window (only succeeds if handshake completed). Initiates polling to establish connection with a child window for the first time.Extends OriginManager for use in child windows. Features:
parentWindow parameter (defaults to window.opener)postMessage(message): Send a message to the parent window (only succeeds if handshake completed and parentWindow exists)import { ParentWindowOriginManager } from '@canton-network/core-origin-check'
// Create a manager instance
const originManager = new ParentWindowOriginManager()
// Send a message using the safe postMessage method
// This will initiate polling if connection is not established,
// and send the message once the handshake is complete
const childOrigin = 'https://child.example.com'
originManager.postMessage({ type: 'greeting', data: 'hello' }, childOrigin)
// Or manually check before sending
if (originManager.assert(childOrigin)) {
window.postMessage(data, childOrigin)
}
import { ChildWindowOriginManager } from '@canton-network/core-origin-check'
// Create a manager instance with optional parent window parameter
const originManager = new ChildWindowOriginManager()
// or specify a parent window explicitly:
// const originManager = new ChildWindowOriginManager(parentWindow)
// The handshake is automatic; once complete, listener is removed
// Send a message using the safe postMessage method
// This will only succeed if the handshake is complete and parent window exists
originManager.postMessage({ type: 'response', data: 'world' })
postMessage() method to automatically validate origins before sendingassert() method checks if an origin has completed the handshakepostMessage() to an unapproved origin will silently failremoveListener() to clean up event listeners when doneFAQs
Secure cross-window origin handshake and guarded postMessage helpers.
We found that @canton-network/core-origin-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.