
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
recourse-verify
Advanced tools
Standalone verification library for RecourseOS attestations. Zero external dependencies.
npm install recourse-verify
import { verifyAttestation } from 'recourse-verify';
const result = await verifyAttestation(attestation, {
trustedInstances: ['https://recourse.example'],
});
if (result.valid) {
console.log(`Verified: key=${result.keyId}, state=${result.keyState}`);
} else {
console.log(`Failed: ${result.reason}`);
}
This library implements the verification procedure from §7.4 of the RecourseOS Attestation Protocol. It verifies attestations issued by any RecourseOS instance without requiring RecourseOS as a dependency.
Part of the RecourseOS project.
verifyAttestation(attestation, options?)Verify a single attestation.
import { verifyAttestation } from 'recourse-verify';
const result = await verifyAttestation(attestation, {
trustedInstances: ['https://recourse.example'],
keyCacheTtlMs: 86400000, // 24 hours (default)
crossCheck: false, // Fetch and compare URL copy
});
if (result.valid) {
console.log(`Verified by key ${result.keyId} (${result.keyState})`);
} else {
console.log(`Verification failed: ${result.reason}`);
}
verifyAttestations(attestations, options?)Verify multiple attestations with shared cache. Pre-fetches all registries before verification to ensure consistency during key rotation.
import { verifyAttestations } from 'recourse-verify';
const results = await verifyAttestations(attestations, {
trustedInstances: ['https://recourse.example'],
});
const allValid = results.every(r => r.valid);
clearRegistryCache()Clear the in-memory key registry cache. Useful for testing or forced refresh.
import { clearRegistryCache } from 'recourse-verify';
clearRegistryCache();
canonicalize(value)Canonicalize a value per RFC 8785 (JSON Canonicalization Scheme).
import { canonicalize } from 'recourse-verify';
const canonical = canonicalize({ b: 1, a: 2 });
// '{"a":2,"b":1}'
| Option | Type | Default | Description |
|---|---|---|---|
trustedInstances | string[] | [] | Allow-list of instance base URLs. Empty = accept any. |
keyCacheTtlMs | number | 86400000 | Cache TTL in milliseconds (24 hours). |
crossCheck | boolean | false | Compare embedded and URL-fetched copies. |
fetch | typeof fetch | global | Custom fetch for testing or non-browser environments. |
Success:
{
valid: true,
keyId: 'recourse-prod-1',
keyState: 'active', // or 'deprecated' or 'retired'
timestamp: '2026-05-01T14:30:00Z'
}
Failure:
{
valid: false,
reason: 'signature_invalid', // see failure reasons below
details: 'Optional error details'
}
| Reason | Description |
|---|---|
invalid_attestation | Missing required fields or malformed attestation |
instance_not_trusted | Attestation from instance not in trustedInstances |
key_not_found | Key ID not found in registry |
key_pending | Key is in pending state (not yet activated) |
key_compromised | Key has been marked compromised |
signature_invalid | Ed25519 signature verification failed |
cross_check_mismatch | Embedded and URL-fetched attestations differ |
network_error | Failed to fetch registry or attestation |
registry_rollback | Fetched registry version < cached version (security) |
Rejects key registries with registry_version lower than cached version. Prevents downgrade attacks where an attacker serves old registry to bypass key compromise.
The trustedInstances option is an allow-list, not trust-without-verification. Attestations from listed instances are still cryptographically verified; attestations from unlisted instances are rejected before verification.
URL matching normalizes:
https://example.com/ = https://example.comhttps://example.com:443 = https://example.comHTTPS://EXAMPLE.COM = https://example.comverifyAttestations pre-fetches all registries before verification, ensuring all attestations in a batch are verified against the same registry snapshot. Prevents inconsistent results during key rotation.
This library implements:
fetch and crypto)MIT
FAQs
Standalone verification library for RecourseOS attestations
We found that recourse-verify demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.