Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@samva/webhooks

Latest version: v0.52.0

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
npm package Publisher: samva
0 Stars
0 Forks
56 Versions
7.5K Downloads
TypeScript Repo language

Scan summary

@samva/webhooks was last scanned on 26 Nov 2026 at version 0.52.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 56 versions; the latest 4 were published within 7 days (20–26 Nov 2026).
  • Findings: No rules fired in version 0.52.0.
  • Downloads: 7,482 downloads.

Versions

56 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.52.0 LATEST 26 Nov 2026 No rules fired
0.51.0 24 Nov 2026 No rules fired
0.50.0 23 Nov 2026 No rules fired
0.49.0 20 Nov 2026 Not shown
0.48.0 18 Nov 2026 Not shown

No rules fired in 0.52.0

Findings

Findings for v0.52.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.52.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@samva/webhooks

Samva is email and WhatsApp for AI agents, and the API developers build on. An agent gets its own address and WhatsApp number, and the same platform covers transactional and campaign sending, inbound replies threaded into conversations, programmable mailboxes, and signed webhooks.

Verify signed Samva webhook deliveries in Node.js, Bun, Cloudflare Workers, and other Web Crypto-compatible runtimes.

import { isKnownEvent, verifyRequest } from "@samva/webhooks";

const verified = await verifyRequest(request, process.env.SAMVA_WEBHOOK_SECRET!);
if (isKnownEvent(verified.event) && verified.event.type === "message.bounced") {
  await suppressRecipient(verified.event.data.recipient, verified.event.data.occurredAt);
}
await persistAndHandleOnce(verified.id, verified.event);

Verification reads the exact request body, validates the Standard Webhooks signature and replay window and the event-specific payload, and returns { id, event }. verified.id matches the webhook-id header. Preserve the raw request body and keep the signing secret on the server.

Effect applications can use the optional Effect entrypoint:

import * as Webhooks from "@samva/webhooks/effect";
import { Effect } from "effect";

export async function verifyEvent(request: Request, secret: string) {
  const program = Webhooks.verifyRequest(request, secret).pipe(
    Effect.map((verified) => verified.event),
  );
  return Effect.runPromise(program);
}

Install the effect version this package lists in peerDependencies when using that entrypoint.

VerifiedWebhook.event is a WebhookEvent: a known SamvaWebhookEvent or an UnknownWebhookEvent with type: string and data: unknown. Call isKnownEvent(event) before branching on event.type to narrow known payloads. Per-event types such as MessageBouncedPayload and ContactUnsubscribedPayload are exported from both entrypoints.

Signature verification is the authenticity gate. Signed new event types pass through as untyped events; extra envelope and payload fields are accepted and preserved. Only malformed envelopes or invalid payloads for known event types fail with MalformedWebhookPayloadError. Update the package to gain types for new events. Bounce and complaint events publish once per affected address, each with its own webhook-id; deduplicate using that ID rather than messageId.

For separate decoding, import MessageBouncedEventSchema or SamvaWebhookEventSchema from @samva/webhooks/schemas (or the Effect entrypoint) and use Schema.decodeUnknownSync. WebhookEventJsonSchemas exports the same wire contracts for JSON Schema validators.

Signing secrets are whsec_ followed by Base64-encoded secret bytes. Copy the entire secret from Samva; the suffix is Base64, not hex or Base64url.

Test your handler

generateWebhookSecret and signWebhook produce the same signed bytes Samva sends, so a test can exercise the success path and the failing-signature path without a live delivery. The fixture below uses an event type the package does not know, which passes through as an untyped event; a known type needs a payload that matches its schema.

import {
  generateWebhookSecret,
  InvalidWebhookHeadersError,
  safeVerify,
  signWebhook,
  verify,
  WebhookSignatureError,
} from "@samva/webhooks";

const secret = generateWebhookSecret();
const body = JSON.stringify({
  type: "example.test",
  timestamp: new Date().toISOString(),
  data: { note: "fixture" },
});
const id = "evt_test_1";
const timestamp = Math.floor(Date.now() / 1000);
const signature = await signWebhook({ body, id, timestamp, secret });
const delivery = { body, id, timestamp: String(timestamp), signature, secret };

await verify(delivery); // resolves { id, event }

// A body changed by one byte fails the signature check.
await verify({ ...delivery, body: `${body} ` }).catch((error) => {
  console.log(error instanceof WebhookSignatureError); // true
});

// An absent header fails before the signature is read.
await verify({ ...delivery, signature: undefined }).catch((error) => {
  console.log(error instanceof InvalidWebhookHeadersError); // true
});

// safeVerify returns the failure instead of rejecting.
console.log((await safeVerify({ ...delivery, body: `${body} ` })).verified); // false

In an HTTP test, send the same webhook-id, webhook-timestamp, and webhook-signature header values (the WEBHOOK_*_HEADER constants) with the signed body, then repeat the request with a changed body and expect your handler to answer 4xx.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @samva/webhooks

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229